[web2py] Re: id.max()

2012-06-17 Thread Anthony
id_max = db.Node.id.max() maxID = db(db.Node).select(id_max).first()[id_max] The key used to store the max value is actually the SQL expression generated by the .max() method, so the following should work as well: maxID = db(db.Node).select(db.Node.id.max()).first()['MAX(Node.id)'] The followin

[web2py] id.max()

2012-06-17 Thread Annet
In a function I need the id of the last record created in a previous session. I tried: maxID=db(db.Node).select(db.Node.id.max()).first().id ... but that results in a key error on id. In a view, this {{=maxID}}, is being rendered as: }> How do I get maxID=2035 Kind regards, Annet

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-17 Thread Anthony
> > > Take it like that. Transactions are a way to provide consistent data to > > every reader/writer connected to a database. > > Right, I've got that part down, it is the "what is the magic that > Web2py is doing behind my back" part that I was (and still a little > bit) unclear on. > I do

[web2py] Re: Web2py RAM usage

2012-06-17 Thread Massimo Di Pierro
Are you using caching? Are you using sqlite? We should nail down the cause of this problem. Did you try to bytecode compile the app? Massimo On Sunday, 17 June 2012 21:17:01 UTC-5, Lucas R. Martins wrote: > > Hi guys, > > I'm running a website with ~ 900 urls and no many daily access in a small

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-17 Thread Massimo Di Pierro
I included your patch but not version V2. That is because we do not want to mantain our own modified bootswatch. People should be able to download a theme and use it without editing. Can this be addressed in web2py.css? On Sunday, 17 June 2012 18:42:12 UTC-5, LightDot wrote: > > I have tested th

[web2py] Re: Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Massimo Di Pierro
Check what's in trunk now. Let me know if you think it needs improvement. On Sunday, 17 June 2012 15:45:41 UTC-5, Cliff Kachinske wrote: > > I agree that the old look, with dividers, *looks* better. > > I also think the buttons are easier to find on the page, so I would like > to optionally use t

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-17 Thread Doug Philips
On Sat, Jun 16, 2012 at 5:56 PM, Niphlod wrote: > The bit of magic that I forgot to tell explicitely is that db.commit() > commits every opened transaction and starts a new one :D Ok, just to double check, that is for all DB back-ends or just for SQLite? > Note, if your site does mostly reading

[web2py] Re: GAE query cursors

2012-06-17 Thread Massimo Di Pierro
uploading :-) On Sunday, 17 June 2012 10:40:51 UTC-5, howesc wrote: > > sorry if i confused you by submitting 2 non-inclusive patches. :( the > reference patch for > https://groups.google.com/forum/?fromgroups#!topic/web2py/mKgLFC5pxcY is > what you applied, and with your change still work

[web2py] Re: Using" _format" in "represent=lambda id, row..."

2012-06-17 Thread Anthony
> > db.define_table (person, Field('name'),format='%(name)s') > db.define_table (dog, Field('name'),Field('owner_id',db.person) > > Using this is okay : > db.dog.owner_id.represent=lambda id,row:db.person(id).name > > But using this fails : > db.dog.owner_id.represent=lambda id,row:db.person(id)._

[web2py] Re: Custom validators error messages

2012-06-17 Thread Anthony
> > db.domains.name.requires =[IS_VALID_A(db, db.domains.name), > IS_NOT_IN_DB(db, db.domains.name)] > Your __init__ function takes two arguments (other than "self", which is the object itself and doesn't get passed explicitly), "object" and "error_message". You pass db as the "object" argume

[web2py] Re: Custom validators error messages

2012-06-17 Thread Jimmy Stewpot
Hello, I am trying to call it like so... db.domains.name.requires =[IS_VALID_A(db, db.domains.name), IS_NOT_IN_DB(db, db.domains.name)] This is the first time I've tried to write a class so it's all new to me. I "copied" an example. - Original Message - From: "Anthony" To: web2py@go

[web2py] Web2py RAM usage

2012-06-17 Thread Lucas R. Martins
Hi guys, I'm running a website with ~ 900 urls and no many daily access in a small vps. I have observed that, when a start the server, this use only 10mb, in my case. However, with the time and natural access (specially googlebot), the server memory usage grow and grows indefinitely until use all

[web2py] Re: contrib spreadsheet enhancement

2012-06-17 Thread Alan Etkin
I can't figure how to implement signed urls in that module. Data syncronization features are configured passing url arguments (which I think leaves using signed urls and verification to the rest of the application code, outside of spreadsheet.py). El viernes, 15 de junio de 2012 13:25:06 UTC-3,

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-17 Thread LightDot
I have tested the V2 versions attached with Issue 856 and they seem to address the issues perfectly. Regards On Sunday, June 17, 2012 9:14:33 PM UTC+2, Paolo Caruccio wrote: > > Patch submitted http://code.google.com/p/web2py/issues/detail?id=856 > > Il giorno domenica 17 giugno 2012 17:32:53 UT

[web2py] Re: Best practice using scheduler as a task queue?

2012-06-17 Thread Michael Toomim
To respond to your last two points: You're right that models only runs on every request... I figured if my website isn't getting any usage then the tasks don't matter anyway. :P Yes, I think there are design issues here, but I haven't found a better solution. I'm very interested in hearing bet

[web2py] Re: Best practice using scheduler as a task queue?

2012-06-17 Thread Michael Toomim
Thanks for the response, niphlod! Let me explain: The task can be marked FAILED or EXPIRED if: • The code in the task throws an exception • A run of the task exceeds the timeout • The system clock goes past stop_time And it will just not plain exist if: • You have just set up the code •

Re: [web2py] csv button

2012-06-17 Thread Cornelius Kölbel
Hi, in the SQLFORM.grid you can have an csv=True (default), that displays an export button, which will export to csv. form = SQLFORM.grid(db.t_product_license, onupdate=auth.archive, fields=[ ... ],

[web2py] Re: Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Cliff Kachinske
I agree that the old look, with dividers, *looks* better. I also think the buttons are easier to find on the page, so I would like to optionally use them. Would you take a patch with the option? On Saturday, June 16, 2012 11:30:04 PM UTC-4, Andrew wrote: > > A week or two ago a change was mad

[web2py] Using" _format" in "represent=lambda id, row..."

2012-06-17 Thread Pierre-Antoine Roiron
Hi, I don't understand why considering the usual : db.define_table (person, Field('name'),format='%(name)s') db.define_table (dog, Field('name'),Field('owner_id',db.person) Using this is okay : db.dog.owner_id.represent=lambda id,row:db.person(id).name But using this fails : db.dog.owner_id.repre

Re: [web2py] csv button

2012-06-17 Thread hasan alnator
can you explain some more please ? best regards, On Sun, Jun 17, 2012 at 9:20 PM, Cornelius Koelbel < cornelius.koel...@lsexperts.de> wrote: > Am 17.06.2012 18:50, schrieb Hassan Alnatour: > > Dear ALL , > > > > How can i create a button that create a csv file for a cretin table ? > > > > >

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-17 Thread Andrew
Yes please Paolo

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-17 Thread Paolo Caruccio
Patch submitted http://code.google.com/p/web2py/issues/detail?id=856 Il giorno domenica 17 giugno 2012 17:32:53 UTC+2, Massimo Di Pierro ha scritto: > > Can you coordinate with Andrew and Paolo and send me a single fix that > applies to latest trunk and addresses the outstanding issues? > > On S

Re: [web2py] csv button

2012-06-17 Thread Cornelius Koelbel
Am 17.06.2012 18:50, schrieb Hassan Alnatour: > Dear ALL , > > How can i create a button that create a csv file for a cretin table ? > > > Best Regards Hi, I think the exportable=True, the export-button should do this. Kind regards Cornelius

[web2py] csv button

2012-06-17 Thread Hassan Alnatour
Dear ALL , How can i create a button that create a csv file for a cretin table ? Best Regards

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-17 Thread Paolo Caruccio
If Andrew and LightDot agree, I will prepare a patch and I'll sumbit it in google issue tracker in next two hours. Il giorno domenica 17 giugno 2012 17:32:53 UTC+2, Massimo Di Pierro ha scritto: > > Can you coordinate with Andrew and Paolo and send me a single fix that > applies to latest trunk

[web2py] Re: GAE query cursors

2012-06-17 Thread howesc
sorry if i confused you by submitting 2 non-inclusive patches. :( the reference patch for https://groups.google.com/forum/?fromgroups#!topic/web2py/mKgLFC5pxcY is what you applied, and with your change still works for me. if the cursor patch in this thread looks ok can you add it as well? thi

Re: [web2py] Re: how to eliminate the path in a table

2012-06-17 Thread Anthony
On Sunday, June 17, 2012 11:30:00 AM UTC-4, praveen krishna wrote: > > Ya I have checked the code 'rev' is generating the value what I expect but > the problem is in inserting the data to database and generating the same > output. > I don't think the problem could be with the insert. Exactly how

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-17 Thread Massimo Di Pierro
Can you coordinate with Andrew and Paolo and send me a single fix that applies to latest trunk and addresses the outstanding issues? On Sunday, 17 June 2012 08:42:50 UTC-5, LightDot wrote: > > I have tried your updated bootswatch.css from another thread here, which > also incorporates this fix.

Re: [web2py] Re: how to eliminate the path in a table

2012-06-17 Thread praveen krishna
Ya I have checked the code 'rev' is generating the value what I expect but the problem is in inserting the data to database and generating the same output. On Sun, Jun 17, 2012 at 5:26 PM, Anthony wrote: > for name in zf.namelist(): >> filename = name.split('/')[-1] >>

[web2py] Re: Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Paolo Caruccio
I sent an email to your gmail account some hours ago. If you prefer I could submit a patch through google issue tracker. Il giorno domenica 17 giugno 2012 17:14:19 UTC+2, Massimo Di Pierro ha scritto: > > Can I get an updated patch? > > On Sunday, 17 June 2012 04:55:25 UTC-5, Andrew wrote: >> >>

Re: [web2py] Re: how to eliminate the path in a table

2012-06-17 Thread Anthony
> > for name in zf.namelist(): > filename = name.split('/')[-1] > file_raw = zf.read(name) > jsoligo = ''.join(split(''.join(file_raw)))[::-1] > rev=(jsoligo[find(jsoligo,'/')+2:find(jsoligo,';')][::-1]) > Have you co

[web2py] Re: Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Massimo Di Pierro
Can I get an updated patch? On Sunday, 17 June 2012 04:55:25 UTC-5, Andrew wrote: > > The blue color was coming from Line 32 from bootstrap.min.css. However , > I started again from a clean welcome app and reinstalled the two files and > the blue is gone, now getting the color from bootswatch.

Re: [web2py] Re: how to eliminate the path in a table

2012-06-17 Thread praveen krishna
My complete code: from sys import argv from string import find, split, strip import os import zipfile def import_files(): items = [] '''stub for import''' form = form_factory(Field('seqzip', 'upload', label="Sequence Files (.zip)", requires=IS_NOT_EMPTY(), uploadfield=False)) if for

[web2py] Re: Custom validators error messages

2012-06-17 Thread Anthony
> > class IS_VALID_A(object): >Name = 'IS_VALID_A' >def __init__(self, object, error_message='Invalid Domain Name'): > Why is "object" the second argument of __init__? What is "object", and are you doing anything with it? Are you passing in a value for "object" when you instantiate th

Re: [web2py] Re: restrict the available choices in a dropdown in sqlform

2012-06-17 Thread Anthony
> > I wonder were I should have read and understood this in the first place. > I think it could be better spelled out, but the section in the DAL chapter on Record Representationmentions that reference fields get a default IS_

Re: [web2py] Re: how to eliminate the path in a table

2012-06-17 Thread Anthony
What's your current complete code for generating the values and inserting them in the db? What's an example of a complete file path and name within the zip file as well as the contents of that file that is producing a value like the ones below? ya its in subfolder but with ' filename = name.spl

[web2py] Re: Anyone using BootSwatch with new web2py layout

2012-06-17 Thread LightDot
I have tried your updated bootswatch.css from another thread here, which also incorporates this fix. I confirm that BS 2.0.4 works now. Thanks! On Sunday, June 17, 2012 12:33:52 AM UTC+2, Paolo Caruccio wrote: > > LightDot, > > try to append in static/css/bootswatch.css this rule: > > .dropdown

Re: [web2py] Re: how to eliminate the path in a table

2012-06-17 Thread praveen krishna
ya its in subfolder but with ' filename = name.split('/')[-1]' I am able to read the file names and with 'file_raw = zf.read(name) ' i am able to read the sequence in the file .But the other problem with table is not solved I am still getting unwanted information like file path for example like "we

Re: [web2py] Infinite loop: Auth using OAuth2 with Facebook

2012-06-17 Thread Michele Comitini
Alec, There could be many reason for that behavior. Two are common: 1. For some reason facebook does not grant access to your application, ex. domain name mismatch. If are you trying on localhost that should not happen. 2. Some problem with cookies, clean the cookies and/or try a different browse

[web2py] Re: favicon problem

2012-06-17 Thread Paolo Caruccio
In my case was a cache problem. Below the solution worked for me: 1. below replacing files clear the cache of browsers (IE9, OP12, FF13, CH19). Repeat the operation if needed. 2. rename the default files (i.e.: __favicon.ico and __favicon.png 3. put new files in static folder 4. open the brow

[web2py] Re: Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Andrew
The blue color was coming from Line 32 from bootstrap.min.css. However , I started again from a clean welcome app and reinstalled the two files and the blue is gone, now getting the color from bootswatch. (cache issue ?) Thanks Paolo. It works great. I've also sent patch file to Massimo, bu

[web2py] Re: Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Paolo Caruccio
For me is indifferent. I looked around the web and some bootstrap sites have a group of buttons and others haven't. Anyway to revert to B1 please apply attached files. About the color, please note that IE7 doesn't support the 'inherit' parameter so we have to apply a workaround (see attached bo

[web2py] Re: Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Andrew
Patch resent. I'll find out why the text is blue.

Re: [web2py] Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Marin Pranjić
B1++ On Sun, Jun 17, 2012 at 5:30 AM, Andrew wrote: > A week or two ago a change was made to the nav bar to give the auth > buttons for Login, Register, etc a button look. This was part of the > fix to the dropdown menus to get them to work with bootstrap. Another > change was made to reve

[web2py] Re: Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Andrew
Hi Anthony, don't know where the blue came from, a CSS class switch I guess. I'll investigate.

Re: [web2py] Re: web2py and python 3.3 ?

2012-06-17 Thread Michele Comitini
+1 2012/6/17 Massimo Di Pierro : > When google moves to 2.7 we will. At this time 3.3 does not buy us anything. > > > On Saturday, 16 June 2012 19:35:21 UTC-5, Bruce Wade wrote: >> >> Will there ever be a plan to support python 3.x? >> >> On Sat, Jun 16, 2012 at 4:26 PM, Massimo Di Pierro >> wrot

Re: [web2py] Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Cornelius Kölbel
As the menu usually also has no button look I also vote b.1 Am 17.06.2012 05:30, schrieb Andrew: > A week or two ago a change was made to the nav bar to give the auth > buttons for Login, Register, etc a button look. This was part of > the fix to the dropdown menus to get them to work with bo

Re: [web2py] Re: restrict the available choices in a dropdown in sqlform

2012-06-17 Thread Cornelius Kölbel
Am 17.06.2012 02:07, schrieb Anthony: > > I will not see the f_contact as a name anymore but only as the ids. > When I remove the requires from the table definition the ids are > resolved to the names again. > > > Sorry, I forgot -- for reference fields, if you don't specify any > val

[web2py] Re: favicon problem

2012-06-17 Thread Don_X
I am having the same problem ... did you find a way to fix this ... please advise ... thank you Don On Monday, 28 May 2012 05:56:07 UTC-4, Marian Siwiak wrote: > > Hello, > > I replaced favicon.ico and favicon.png file in "static" folder of my app, > but on my webpage I still get an old i