[web2py:19853] Mutable urls

2009-04-15 Thread Italo Maia
I was trying to make one of those fancy url behaviors where the name of the url actually has some meaning. Well, i was trying to create a blog and wanted to have this kind of url to be valid: http://site.com/blog/blog-name/year/month/day/id/ would be valid and the parameters blog-name, year, mon

[web2py:19852] Re: redirect and response.flash

2009-04-15 Thread Italo Maia
After changes in the database, like submiting a form, if you're not "ajaxing things up!", is good practice to redirect the user to some page. This avoids the problem where the refresh button from the browser would re-submit the form and stuff like that. If you can't send flash messages after a red

[web2py:19851] How do I add a class to an input button?

2009-04-15 Thread Jason Brower
I can't grab a button, like submit buttons, with jquery. At least as far as I can tell. I have to add a class to them. So... How do I add a class to buttons in my SQLForms? BR Jason Brower --~--~-~--~~~---~--~~ You received this message because you are subscr

[web2py:19850] Re: web2py_path setting in gluon/main.py causing problems for scripts

2009-04-15 Thread Guido Kollerie
On 8-apr-2009, at 18:33, mdipierro wrote: > OK, uploading to trunk. Thanks. I see you have reverted the change: http://code.google.com/p/web2py/source/diff?spec=svn822&r=822&format=side&path=/trunk/gluon/main.py&old_path=/trunk/gluon/main.py&old=817 due to "__file__ caused problems on o

[web2py:19849] Re: The session dies and I have to reload a page to bring it back up and other issues...

2009-04-15 Thread Jason Brower
Sorry, I haven't a clue how to do that. :( But would be happy to learn. BR Jason Brower On Wed, 2009-04-15 at 21:50 -0700, mdipierro wrote: > The editor is not supposed to expire the session because there is a > keepalive ajax request. > If it is disconnecting you than there is a bug. Can you a

[web2py:19847] Re: redirect and response.flash

2009-04-15 Thread mdipierro
I think that storing messages in the database is overkill and storing them in cookies is unsafe (unless we encrypt cookies and that is also overkill) and would not work when cookies are off. What is so bad about the current way of doing it? Massimo On Apr 15, 10:21 pm, Italo Maia wrote: > In d

[web2py:19848] Re: db.Field or SQLField??

2009-04-15 Thread mdipierro
db.Field() because it avoid conflicts when running on Google App Engine. On Apr 15, 10:37 pm, Italo Maia wrote: > Just saw a video (http://www.vimeo.com/2720410) where db.Field was > user, and not SQLField...Which should be used? --~--~-~--~~~---~--~~ You received

[web2py:19846] Re: The session dies and I have to reload a page to bring it back up and other issues...

2009-04-15 Thread mdipierro
The editor is not supposed to expire the session because there is a keepalive ajax request. If it is disconnecting you than there is a bug. Can you add a print statement to the admin/controller/keepalive and check what is going on? Massimo On Apr 15, 10:08 pm, Jason Brower wrote: > A minor issu

[web2py:19845] Re: Can response.flash have different colors?

2009-04-15 Thread mdipierro
response.flash is just a variable and so is session.flash. session.flash is copied into response.flash after redirection. You are free to do things like: session.flash=['warning','red','message'] or session.flash='warning/red/message' and have the JS break use its components. I'd prefer to le

[web2py:19844] db.Field or SQLField??

2009-04-15 Thread Italo Maia
Just saw a video (http://www.vimeo.com/2720410) where db.Field was user, and not SQLField...Which should be used? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, se

[web2py:19843] Re: redirect and response.flash

2009-04-15 Thread Italo Maia
In django, they use a messaging system based in the database, and relate messages from the user with his session. When the message is fetched to the user, it is then removed immediatly. That makes it possible for redirects to show messages for an user after a redirect, tought it does not work for

[web2py:19842] Giving a class to all buttons.

2009-04-15 Thread Jason Brower
I am trying to make jquery pull all the buttons made in my forms and turn them into nice looking html buttons. I have all the code ready except that I don't know how to set a class to a button. I didn't notice any class set to the buttons now either. What would be the best approach to this? Regar

[web2py:19841] The session dies and I have to reload a page to bring it back up and other issues...

2009-04-15 Thread Jason Brower
A minor issue I am sure, but when I am developing I leave all the windows open just the way a like and suspend and comeback at a later time. Doing so makes my editor windows say the have a "communication error" because my session timed out. I would like it to be able to let me log back in to my

[web2py:19840] Re: Can response.flash have different colors?

2009-04-15 Thread Jason Brower
Sure. I even have a totally different design for mine. I made it fade in instead, and I had it use an entire block. I did that with the jquery calls in the web_ajax.html file in the view section. Then I set the area in my layout.html. Basically, take the old flash area text and cut and past it

[web2py:19839] Can response.flash have different colors?

2009-04-15 Thread Iceberg
Currently I think most of us use response.flash as a resort to give all kinds of feedback. For example: def foo(): form=SQLFORM(...) if form.accepts(...): if there_is_some_minor_issue: response.flash='Warning: your input is unusual, but anyway the data is accepted' else: r

[web2py:19838] Re: Conditioning IS_IN_DB

2009-04-15 Thread mdipierro
This is not a bug. I misunderstood the question. db.define_table('states', SQLField('State','string',length=2) ) db.define_table('provider', ... ... SQLField('State'), ### has to be a string to store a string in it.

[web2py:19837] Re: redirect and response.flash

2009-04-15 Thread mdipierro
Because I cannot find a way to make it work. I do not believe it is possible. I may be wrong and if you find a way send me a patch. Massimo On Apr 15, 6:38 pm, ceej wrote: > Is there a reason response.flash doesn't work with redirect('/') ? --~--~-~--~~~---~--~~

[web2py:19836] Re: default as update instead of read

2009-04-15 Thread mdipierro
Currently there is no flag to change it. I will add one. Massimo On Apr 15, 5:40 pm, Wes James wrote: > Is there a line for update instead of read for: > > /default/data/select/table > > I'd like to have the select links be updates > > .../default/data/update/table/id > > instead of > > ...

[web2py:19835] Re: Conditioning IS_IN_DB

2009-04-15 Thread mdipierro
Let me look into this tonight. It may be a bug. Massimo On Apr 15, 3:29 pm, JohnMc wrote: > Hmm. Unfortunately I receive -- > >   File "/home/rootuser/web2py/gluon/sqlhtml.py", line 544, in accepts >     fields[fieldname] = int(fields[fieldname]) > ValueError: invalid literal for int() with bas

[web2py:19834] redirect and response.flash

2009-04-15 Thread ceej
Is there a reason response.flash doesn't work with redirect('/') ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscr

[web2py:19833] default as update instead of read

2009-04-15 Thread Wes James
Is there a line for update instead of read for: /default/data/select/table I'd like to have the select links be updates .../default/data/update/table/id instead of .../default/data/read/table/id thx, -wj --~--~-~--~~~---~--~~ You received this message be

[web2py:19832] Re: Conditioning IS_IN_DB

2009-04-15 Thread JohnMc
Hmm. Unfortunately I receive -- File "/home/rootuser/web2py/gluon/sqlhtml.py", line 544, in accepts fields[fieldname] = int(fields[fieldname]) ValueError: invalid literal for int() with base 10: 'TX' Thanks On Apr 15, 3:06 pm, mdipierro wrote: > db.provider.State.requires=IS_IN_DB(db,'st

[web2py:19831] Re: Conditioning IS_IN_DB

2009-04-15 Thread mdipierro
db.provider.State.requires=IS_IN_DB(db,'states.State','%(State)s') Massimo On Apr 15, 2:59 pm, JohnMc wrote: > I have a similar situation to that of Mr. Jeppesen. Here is the setup > -- > > db.define_table('states', >                 SQLField('State','string',length=2) > > ) > > db.define_table

[web2py:19830] Re: Conditioning IS_IN_DB

2009-04-15 Thread JohnMc
I have a similar situation to that of Mr. Jeppesen. Here is the setup -- db.define_table('states', SQLField('State','string',length=2) ) db.define_table('provider', ... ... SQLField('State',db.states), ...

[web2py:19829] web2py 1.61.1 is out

2009-04-15 Thread mdipierro
Fixes a bug introduced in 1.61 that caused inability to run bytecode compiled apps. Thanks to CJ for reporting this. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to th

[web2py:19828] Re: Problem with pack (truncated tar files)

2009-04-15 Thread Yarko Tymciurak
this is interesting as I was going to ask when we would work on being 2.6 compatible (since I started looking at parsers, and may have other interests in potentially using 2.6+ only things). On Tue, Apr 14, 2009 at 11:05 PM, mdipierro wrote: > > There is a python 2.5 requirement mostly beca

[web2py:19827] Re: WSGI, Apache2, and web2py NOT at root

2009-04-15 Thread Mark Larsen
> See if http://forum.webfaction.com/viewtopic.php?pid=8473#p8473 > provides any hints for you Thanks Yarko. It still has the troublesome line: WSGIScriptAlias / /home/[YOUR ACCOUNT]/webapps/apachewsgi/web2py/wsgihandler.py Which essentially tells apache to handle anything coming at the ro

[web2py:19826] Re: RFC auto fields

2009-04-15 Thread Yarko Tymciurak
Hi Massimo - I will be at choir tonight (it's a "in one house" rehearsal w/ several choirs) and go to Poor Phils, but I will need to ride home tonight (Joan wanted "a break, with no phone calls" -- I have no idea what is going on...) I have been tired / exhausted this past month, so I will not stay

[web2py:19825] Re: SystemError: NULL result without error in PyObject_Call

2009-04-15 Thread mdipierro
Thanks for letting us know. I am sure others will find the information useful. This type of wsgi issues are a mistery to me. Massimo On Apr 15, 10:16 am, stefan wrote: > Thank you very much. > Indeed, mod_mem_cache was the problem. > Once disabled, the page loaded as expected. > > Thank you. >

[web2py:19824] Re: SystemError: NULL result without error in PyObject_Call

2009-04-15 Thread stefan
Thank you very much. Indeed, mod_mem_cache was the problem. Once disabled, the page loaded as expected. Thank you. On 15 Apr, 18:06, mdipierro wrote: > Follow this thread... > > http://www.modpython.org/pipermail/mod_python/2008-December/025871.html > > They have a solution. It is not a web2py

[web2py:19823] Re: SystemError: NULL result without error in PyObject_Call

2009-04-15 Thread mdipierro
Follow this thread... http://www.modpython.org/pipermail/mod_python/2008-December/025871.html They have a solution. It is not a web2py problem. Massimo On Apr 15, 9:33 am, stefan wrote: > Hello, > > Trying to get web2py to work with mod_wsgi but still no > luck.http://myIP/welcome/default/in

[web2py:19822] Re: dataTables and date

2009-04-15 Thread mdipierro
can you post the language file? what database are you using? Massimo On Apr 15, 9:10 am, jmverm...@xs4all.nl wrote: > Massimo, > > > SQLField('datum',type='date',requires=IS_DATE(str(T('%Y-%m-%d' > > I changed this. > > > The main problem is here: > > > > fromdate=request.vars.datum > > > to

[web2py:19821] SystemError: NULL result without error in PyObject_Call

2009-04-15 Thread stefan
Hello, Trying to get web2py to work with mod_wsgi but still no luck. http://myIP/welcome/default/index shows Internal error and the issued ticket number/link. My current setup is: Apache/2.2.3 (CentOS_x64) DAV/2 mod_wsgi/2.4 Python/2.5.4 PHP/5.1.6 mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Python

[web2py:19820] Re: Validation

2009-04-15 Thread mdipierro
If required validate it as a date: SQLField('datum',type='date',requires=IS_DATE(str(T('%Y-%m-%d' else SQLField('datum',type='date',requires=IS_NULL_OR(IS_DATE(str(T('%Y-%m- %d') Massimo On Apr 15, 9:30 am, annet wrote: > In a previous post Massimo corrected the following definition:

[web2py:19819] Validation

2009-04-15 Thread annet
In a previous post Massimo corrected the following definition: SQLField('datum',type='date',requires=[IS_DATE(str(T('%Y-%m- %d'))),IS_NOT_EMPTY()]) It should be: SQLField('datum',type='date',requires=IS_DATE(str(T('%Y-%m- %d' In this specific case the date field is required, however, I a

[web2py:19818] Re: dataTables and date

2009-04-15 Thread jmvermeer
Massimo, > SQLField('datum',type='date',requires=IS_DATE(str(T('%Y-%m-%d' I changed this. > The main problem is here: > > > fromdate=request.vars.datum > > todate=IS_DATE()(fromdate)[0]+datetime.timedelta(days=int(request.vars.dage > > n)) These lines now read like: fromdate=request.v

[web2py:19817] Re: Conditioning IS_IN_DB

2009-04-15 Thread mdipierro
This cannot be done out of the box. You need to use ajax to make a part of page dependent on another part of the same page. assuming you have form=SQLFORM(db.tourplan), the in your HTML you need something like $('#tourplan_city').change(function(){ $.ajax( ) } and write the code t

[web2py:19816] Re: question about db api

2009-04-15 Thread mdipierro
You can do this: query="%s.id>0" % (table) records=SQLTABLE(db(query).select()) or this: query=db[table].id>0 records=SQLTABLE(db(query).select()) Notice that in the first case you have quotes so you are writing raw SQL, hence no db exists (the db connection object is only known to web2py not

[web2py:19814] question about db api

2009-04-15 Thread Samit Pal
Hi, I am a python and web2py newbie. Sorry in advance for the dumb question. I am trying to use the following code table=request.vars.table # This gives us the table name to query query="db.%s.id>0" % (table) # this sets up the query records=SQLTABLE(db(query).select()) # this should get us rec

[web2py:19815] Conditioning IS_IN_DB

2009-04-15 Thread Morten Jeppesen
Hi all Posted this already - but apparently it did not show - so here we go again. I have the following problem (I am a rookie - so forgive me if this is already explained elsewhere): db.define_table('country', SQLField('name','string')) db.define_table('city', SQLField('country',db.countr

[web2py:19813] Re: Issue: sqlite:memory:

2009-04-15 Thread mdipierro
Yes. that is why we do not have it yet. This is the problem to be solved On Apr 15, 3:53 am, AchipA wrote: > Careful with sessions in ram. Your app can go schizophrenic if you > have, say, multiple wsgi processes. Your user would appear to have one > session when going to one of the processes, a

[web2py:19812] Re: Setting default language

2009-04-15 Thread mdipierro
yes SQLField(,label=T("whatever")) On Apr 15, 3:39 am, CK Ng wrote: > Is it possible to T.force('en-zh') for SQLFORM label? > > def adduser(): >     form = SQLFORM(db.user) >     return dict(form=form) --~--~-~--~~~---~--~~ You received this message because y

[web2py:19811] Re: dataTables and date

2009-04-15 Thread mdipierro
This SQLField('datum',type='date',requires=[IS_DATE(str(T('%Y-%m- %d'))),IS_NOT_EMPTY()]) should be SQLField('datum',type='date',requires=IS_DATE(str(T('%Y-%m-%d' other than that it is fine. The main problem is here: > fromdate=request.vars.datum > todate=IS_DATE()(fromdate)[0]+datetim

[web2py:19810] Re: Poor performance on GAE

2009-04-15 Thread Robin B
I am also not happy with the CGI performance of GAE. Some interesting numbers: welcome/default/index: cold request time: ~1500ms warm request time: ~150ms (about 1/10 time of a cold request) a warm process is reaped in just *60 sec* if there is no activity. If you have a low activity site, w

[web2py:19809] Re: dropbox in form_factory

2009-04-15 Thread jmvermeer
Denes, > form_factory already gives you the dropbox using the OptionsWidget. > Do you want something different?. No, I would like to use the OptionWidget. I had a look at the OptionsWidget class in gluon/sqlhtml file, but wasn't able to figure out how to use it in a function. form=form_factory

[web2py:19808] Re: Issue: sqlite:memory:

2009-04-15 Thread AchipA
Careful with sessions in ram. Your app can go schizophrenic if you have, say, multiple wsgi processes. Your user would appear to have one session when going to one of the processes, and another when ending up on the other wsgi process. The same caveat exists with cache.ram With the disk-on-app yo

[web2py:19807] Re: Setting default language

2009-04-15 Thread CK Ng
Is it possible to T.force('en-zh') for SQLFORM label? def adduser(): form = SQLFORM(db.user) return dict(form=form) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to th

[web2py:19806] Re: dataTables and date

2009-04-15 Thread jmvermeer
Massimo, I had to add: T.force('en-nl') to db.py to get the strings translated. This introduced the following error: File "/Library/Python/2.5/site-packages/web2pyfitwise/applications/ core/controllers/eventlist.py", line 25, in byplace todate=IS_DATE()(fromdate)[0]+datetime.timedelta(da