Re: [web2py] please help me test new form API

2011-08-14 Thread pbreit
I'm not totally clear on the gain here. Is it that flash messages get automatically set? Is this going to splinter implementations (ie some will use .accepts, some will use .process, others will use .validate)? Is that a good thing?

[web2py] new Reference.get (polymorphic with Row.get)

2011-08-14 Thread Carlos
Hi Massimo, Can you please include the following in trunk for Reference?: def get(self, key): return self.__getattr__(key) This way, Reference and Row both respond to the 'get' method, polymorphism. I believe this does not break anything else. Thanks, Carlos

[web2py] Re: MySQL query not reflecting actual state of db

2011-08-14 Thread G
What you say makes sense in cases where the databse is being modified (update/insert/delete, etc). But in this case, the query in the loop of side1() does not change the database state, it's simply looking for a change in the database, so I wouldn't think it would require a db.commit. On Aug 14, 2

[web2py] Re: Problem using MySQL with scheduler.py

2011-08-14 Thread G
Hi Massimo, The new code you offered causes a compaint about bad MySQL syntax. _mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';))' at line 1") Changing update to _up

[web2py] Re: Virtual Fields. Strange behavior when saving db result sets Build in types

2011-08-14 Thread Michael Toomim
I don't have a direct solution, but FYI I added this info to a bug report on a related topic. http://code.google.com/p/web2py/issues/detail?id=374 Thanks for pointing out the problem. On Aug 14, 8:57 am, Santiago Gilabert wrote: > anyone? > > I found that someone else asked about the same issue

[web2py] can I turn off the auto back-references?

2011-08-14 Thread Carlos
Hi Massimo, Is it possible to turn off back-references (reference fields from other tables back to my table as Set objects)?. I need the following to work: myrow.get('fieldname', 'othervalue') But if 'fieldname' happens to be the same as the tablename of one of such back-references, then i

[web2py] Re: I keep getting the error: invalid literal for int() with base 10: 'Plumber'

2011-08-14 Thread Anthony
On Sunday, August 14, 2011 7:05:17 PM UTC-4, Jarrod Cugley wrote: > > Woohoo it's now working! Thank you Anthony!!! > > 2 questions: > > 1. When I have > > listing.title.requires = [IS_IN_DB(db, db.title.id, '%(name)s')] > > as a list (which is how I want it, it doesn't seem to let me register, > i

Re: [web2py] please help me test new form API

2011-08-14 Thread Bruno Rocha
You can also do. def action(): return dict(form=SQLFORM(db.table).process()) Or. def action(): form = SQLFORM(...) form.validate() # as shortcut to if form.accepts... return dict(form=form) http://zerp.ly/rochacbruno Em 14/08/2011 19:14, "Massimo Di Pierro" escreveu: > We used

[web2py] Re: I keep getting the error: invalid literal for int() with base 10: 'Plumber'

2011-08-14 Thread Jarrod Cugley
Woohoo it's now working! Thank you Anthony!!! 2 questions: 1. When I have listing.title.requires = [IS_IN_DB(db, db.title.id, '%(name)s')] as a list (which is how I want it, it doesn't seem to let me register, it still expects an int, how can I make it expect a string that's equal to an id

[web2py] Re: Problem using MySQL with scheduler.py

2011-08-14 Thread Massimo Di Pierro
Can you help me test if replaceing this: subselect = db(query)._select( db.task_scheduled.id,limitby=(0,1), orderby=db.task_scheduled.next_run_time) db(db.task_scheduled.id.belongs(subselect)).update( status=RUNNING, assigned_worker_n

[web2py] please help me test new form API

2011-08-14 Thread Massimo Di Pierro
We used to do form.accepts(...), later Bruno added form.validate(...) and form.process(...). Now we extended this to work with both FORMs and SQLFORMs so instead of: form = SQLFORM(...) if form.accepts(request,session): # success elif form.errors: # failure else: # nothing happened now y

[web2py] Re: Problem using MySQL with scheduler.py

2011-08-14 Thread Massimo Di Pierro
If this is not done in one line, it is not atomic and results into the problems. On 13 Ago, 13:00, G wrote: > As a quick workaround, this change in assign_next_task seems to do the > trick: > >         subselect = db(query).select( >             db.task_scheduled.id,limitby=(0,1), >             o

[web2py] Re: component-generated field not getting accepted first time

2011-08-14 Thread Massimo Di Pierro
in your models add a print request.env.path_info you may find somehow you have one more call than you think which resets the session. This may be due to a broken link in the view. On 14 Ago, 14:01, weheh wrote: > As you can see, nothing really fancy here. > > def my_action(): >     form=SQLFORM

[web2py] Re: MySQL query not reflecting actual state of db

2011-08-14 Thread Jay
This is required because you are using the DAL outside web2py framework, """ from gluon import * import time db = DAL('mysql://web2py:web2p ... """ When used like above, you have to call db.commit to complete the transaction. Normally all database insert/updates/deletes are committed at the end

[web2py] Re: component-generated field not getting accepted first time

2011-08-14 Thread Anthony
Hmm, I tried your exact code, and it works for me (whether or not I'm logged in). When you first submit, are the appropriate variables coming through in request.vars? Can you use the browser developer tools to check the HTML of the form when it is first loaded? Anthony On Sunday, August 14, 2

[web2py] Re: w2p on ubuntu

2011-08-14 Thread pbreit
It's difficult to make scripts that work for every situation. One thing you can try is instead of running the script, just careful run each command manually, picking and choosing which ones you think you need. I've also put up some other scripts here: https://bitbucket.org/pbreit/web2py-automati

Re: [web2py] Re: infoworld put web2py in the top of python frameworks

2011-08-14 Thread António Ramos
Of course. :P 2011/8/14 weheh > Yaay! But then, we knew this all along, right? > > On Aug 14, 2:40 pm, Anthony wrote: > > On Sunday, August 14, 2011 11:55:11 AM UTC-4, Ramos wrote: > > > > > No, i just logged in and only see 3 pages. > > > > On the third page of the overview article, there is a

[web2py] Re: infoworld put web2py in the top of python frameworks

2011-08-14 Thread weheh
Yaay! But then, we knew this all along, right? On Aug 14, 2:40 pm, Anthony wrote: > On Sunday, August 14, 2011 11:55:11 AM UTC-4, Ramos wrote: > > > No, i just logged in and only see 3 pages. > > On the third page of the overview article, there is a table listing the 6 > frameworks -- if you clic

[web2py] Re: component-generated field not getting accepted first time

2011-08-14 Thread weheh
As you can see, nothing really fancy here. def my_action(): form=SQLFORM.factory( Field('text_field','text', length=10 if auth.user_id else 50, default=T("default text") if not auth.user_id else '', requires=IS_NOT_EMPTY()),

Re: [web2py] Re: infoworld put web2py in the top of python frameworks

2011-08-14 Thread Anthony
On Sunday, August 14, 2011 11:55:11 AM UTC-4, Ramos wrote: > > No, i just logged in and only see 3 pages. > On the third page of the overview article, there is a table listing the 6 frameworks -- if you click on the name of a framework in that table, it takes you to the more detailed article for

[web2py] Re: component-generated field not getting accepted first time

2011-08-14 Thread Anthony
Can you show your controller and view code? On Sunday, August 14, 2011 2:14:19 PM UTC-4, weheh wrote: > I have a componentized form that is behaving very strangely. The form > is very simple -- just a text field. > > form=SQLFORM.factory(Field('text_in','text')) > > if form.accepts(request

[web2py] component-generated field not getting accepted first time

2011-08-14 Thread weheh
I have a componentized form that is behaving very strangely. The form is very simple -- just a text field. form=SQLFORM.factory(Field('text_in','text')) if form.accepts(request.vars, session): do stuff ... The first time I load the form, it loads fine. I traced it in Eclipse and saw

Re: [web2py] how to generate PDF (with data) using PDF static forms?

2011-08-14 Thread Carlos
Thanks for your suggestion Mariano. Carlos

Re: [web2py] routes.py and rewriting URLs

2011-08-14 Thread Jonathan Lundell
On Aug 14, 2011, at 3:26 AM, fishwebby wrote: > I'm struggling with the routing in web2py and I'm hoping someone can > point me in the right direction (I'm a web2py newbie). > > I want to change this (which works): > > http://127.0.0.1:8000/init/admin_courses/index > > to this: > > http://127.

[web2py] Re: Virtual Fields. Strange behavior when saving db result sets Build in types

2011-08-14 Thread Santiago Gilabert
anyone? I found that someone else asked about the same issue 5 month ago but there are no comments about it. http://groups.google.com/group/web2py/browse_thread/thread/845e6cdef5de4e92/4ace7b81d9e239c3?lnk=gst&q=Virtual+fields&pli=1 Thanks Santiago On Sat, Aug 13, 2011 at 7:07 PM, Santiago wr

Re: [web2py] Re: infoworld put web2py in the top of python frameworks

2011-08-14 Thread António Ramos
No, i just logged in and only see 3 pages. Can you make a pdf out of the 21 pages you said? thank you António 2011/8/11 Massimo Di Pierro > Did you see only the 3 summary pages or the 21 pages of with more > detailed comments about each of the framework? > > You need to login and you need to c

[web2py] routes.py and rewriting URLs

2011-08-14 Thread fishwebby
Hi, I'm struggling with the routing in web2py and I'm hoping someone can point me in the right direction (I'm a web2py newbie). I want to change this (which works): http://127.0.0.1:8000/init/admin_courses/index to this: http://127.0.0.1:8000/admin/courses but I can't get it to work with the

[web2py] segmentation fault using rocket

2011-08-14 Thread MojaveKid
Hi. Lately, Ive been encountering segmentation fault using the rocket web server. I tried: python web2py.py python anyserver.py -s rocket and encountered the seg faults However, the faults are not occuring when i use tornado. I was unsuccessful in locating the seg faults. Im using web2py v1.98

[web2py] Re: I keep getting the error: invalid literal for int() with base 10: 'Plumber'

2011-08-14 Thread Anthony
Is "Plumber" being entered in the 'title' field of the user table? If so, that field is expecting an integer because it is a reference to the 'id' field of the 'title' table (which is an integer field). listing.title.requires = [IS_IN_DB(db, db.title.name)] Your validator, on the other hand,

Re: [web2py] Table creation in GAE

2011-08-14 Thread Martín Mulone
yes 2011/8/13 ram > Is the following statement correct? > A Table is created in GAE only when the first record is inserted. -- http://martin.tecnodoc.com.ar

Re: [web2py] Noob question - Choices definition in Field - DAL

2011-08-14 Thread Martín Mulone
Field ('gender', requires=IS_IN_SET (['Male', 'Female', 'Other'])), 2011/8/13 ram > Is it possible to this using DAL, using Field definition? > > role = db.StringProperty(required=True, choices=s

[web2py] I keep getting the error: invalid literal for int() with base 10: 'Plumber'

2011-08-14 Thread Jarrod Cugley
Hi guys this is my first post so just let me know if I'm doing anything wrong :) (Massimo recommended I ask questions here about web2py rather than on Stack Overflow) As the title says: I keep getting the error: invalid literal for int() with base 10: 'Plumber' I've done searching and it seems to

[web2py] bulkloader & web2py

2011-08-14 Thread Amnon Khen
Dear web2py community, I was wondering if anyone figured out how to upload data to a GAE app and getting the entity IDs right. Here's what I try: 1. Entities creates by web2py have their ID populated to a numeric value and the "key name" empty. 2. When I export (appcgy.py download_data) the data

[web2py] w2p on ubuntu

2011-08-14 Thread Vineet
This refers to the following thread--- https://groups.google.com/group/web2py/browse_thread/thread/4350a3b6836f9dd4/dca9c0e1f1c7540b?lnk=gst&q=ubuntu @Preit, excellent work for preparing the script. I'm encouraged to see that the w2p community is always active. It is really nice to work with web2py

Re: [web2py] Re: ANN: ide2py: editor, shell and debugger for web2py (experimental)

2011-08-14 Thread José Luis Redrejo Rodríguez
2011/8/12 Mariano Reingart : > Thanks Jose, I've create an issue as this is important to get it > working on most platform and versions. > > http://code.google.com/p/rad2py/issues/detail?id=3 > > I've sent a mail to the wx-users mailing list, if the error persists, > I'll change to standard toolbar