Re: [web2py] Reverse table look up in GAE

2010-09-09 Thread b vivek
Ok so if i have a table in my db named homepage as below:- -- id | data | --- 1 | vivek| -- 2 | andrew| --- Now if I want to retrieve only the last row .. i can do this

[web2py] How to insert only new items in db as fast as possible?

2010-09-09 Thread Miguel
Hi I have the following table: db.define_table(products, Field(categoryID, db.productCategory, writable=False, readable=False, requires=IS_IN_DB(db, productCategory.id, productCategory.name) ), # reference field Field(productName, 'string',length=512, default=None),

[web2py] Re: custom validation, was: Re: IS_IN_DB referencing linked tables

2010-09-09 Thread annet
Something like this in the controller: eventtyperows=db(db.event.eventtype==db.eventtype.id).\ select(db.event.eventtype,db.eventtype.eventtype,\ distinct=True,orderby=db.eventtype.eventtype) a=[e.event.eventtype for e in eventtyperows] b=[e.eventtype.eventtype for e in eventtyperows]

[web2py] split rows object in view.

2010-09-09 Thread annet
I have the following code in a view: ul {{for row in rows:}} li{{=row.facility}}/li {{pass}} /ul The length of rows varies. I would like to split the list in two list and display it in two columns instead of one. Is it possible to do this in the view, or should the function return rows_1

Re: [web2py] split rows object in view.

2010-09-09 Thread Kenneth Lundström
One way of solving this would be like this: table {{counter = 1}} {{for row in rows:}} {{if counter == 1:}} trtd{{=row.facility}}/td {{counter = 2}} {{else:}} td{{=row.facility}}/td/tr {{counter = 1}} {{pass}} {{pass}} /table Kenneth I have the following

[web2py] Re: lazy virtualfields

2010-09-09 Thread Niphlod
Perfect I think this can be added to the relevant section of the book, I didn't find anything about that, also on the internet... Thanks a lot, though. Niphlod On 8 Set, 03:08, mdipierro mdipie...@cs.depaul.edu wrote: Sorry for the lat reply. This is not a bug. This is a design issue

[web2py] Re: split rows object in view.

2010-09-09 Thread annet
Hi Kenneth, Thanks for your instant reply, problem solved! Kind regards, Annet

[web2py] Re: Reverse table look up in GAE

2010-09-09 Thread Martin.Mulone
Yes but i think this is gae thing. You try? with max(id) or add some datetime field and order by this field like Field('created_on', 'datetime', default=datetime.datetime.today(),writable=False,readable=False) On 9 sep, 03:06, b vivek bvivek1...@gmail.com wrote: Ok so if i have a table in my db

[web2py] cherokee problem with fastcgi and uWSGI

2010-09-09 Thread salbefe
Hello, I'm trying to deploy web2py with cherokee on a fedora core 13 distro but I have several problems on it. I have read the slice web2py with Cherokee via uWSGI: a simple, easy guide that it could be found in web2pyslices but this guide is outdated because it seems to be done for an older

[web2py] Making asynchronous request in web2py

2010-09-09 Thread Adi
Hi, I have this test case: 1. User registers in app. 2. App sends him greeting email (Welcome to so-and-so app). 3. App adds his email/name etc to mailing application (like Mailchimp) for auto-subscribing to newsletter. Now user expects steps 1 completion to take him to the next 'default/

[web2py] Why Django Sucks (slides)

2010-09-09 Thread Adi
http://www.scribd.com/doc/37113340/Why-Django-Sucks-and-How-we-Can-Fix-it It would be interesting to head community's thoughts on some of the problems there. :)

Re: [web2py] cherokee problem with fastcgi and uWSGI

2010-09-09 Thread Roberto De Ioris
Il giorno 09/set/2010, alle ore 12.42, salbefe ha scritto: Hello, I'm trying to deploy web2py with cherokee on a fedora core 13 distro but I have several problems on it. I have read the slice web2py with Cherokee via uWSGI: a simple, easy guide that it could be found in web2pyslices but

[web2py] Re: web2py_vs_others missing T() section!

2010-09-09 Thread mdipierro
Thank you! On Sep 8, 11:45 pm, Relsi Hur relsi.ram...@gmail.com wrote: Hi Massimo, I have here an editable version of the document which I will translate to Portuguese soon, if you want to catch: https://docs.google.com/document/edit?id=14jfi7HUf-F41N6HHvqx87S3GTHQ...

[web2py] intercepting SQLFORM delete

2010-09-09 Thread Richard
I want to do some preprocessing before permitting SQLFORM to delete a record: topic = db.topic[topic_id] form = SQLFORM(db.topic, topic) if form.accepts(request.vars, session, dbio=False): if form.vars.get('delete_this_record'): response.flash = 'Delete intercepted' else:

[web2py] Re: Routes.py on GAE

2010-09-09 Thread Richard
I am using the following simple routes.py and find it works fine on GAE with latest trunk: routes_in = ( ('/', '/init/default/index'), ('/topics', '/init/topics/index'), ) routes_out = [(second, first) for (first, second) in routes_in] On Sep 9, 9:49 pm, mdipierro

[web2py] Re: intercepting SQLFORM delete

2010-09-09 Thread mdipierro
oops. fixed in trunk On Sep 9, 7:50 am, Richard richar...@gmail.com wrote: I want to do some preprocessing before permitting SQLFORM to delete a record: topic = db.topic[topic_id] form = SQLFORM(db.topic, topic) if form.accepts(request.vars, session, dbio=False):     if

[web2py] Re: Routes.py on GAE

2010-09-09 Thread mdipierro
I do not understand where unable to import Rocket comes from. On Sep 9, 8:03 am, Richard richar...@gmail.com wrote: I am using the following simple routes.py and find it works fine on GAE with latest trunk: routes_in = (     ('/', '/init/default/index'),     ('/topics',

[web2py] Re: cherokee problem with fastcgi and uWSGI

2010-09-09 Thread Jose
On 9 sep, 07:42, salbefe salb...@gmail.com wrote: Hello, I'm trying to deploy web2py with cherokee on a fedora core 13 distro but I have several problems on it. I have read  the slice web2py with Cherokee via uWSGI: a simple, easy guide that it could be found in web2pyslices but this guide

Re: [web2py] Re: Routes.py on GAE

2010-09-09 Thread Jonathan Lundell
On Sep 9, 2010, at 6:27 AM, mdipierro wrote: I do not understand where unable to import Rocket comes from. That's a strange error. Also, the syntax error on routes.py is on line 3, which is empty; there's no code until line 4. My advice is to resolve the first error (Rocket) before worrying

[web2py] Re: Routes.py on GAE

2010-09-09 Thread mdipierro
gaehanlder.py does not import Rocket. Is it possible gaehandler.py or app.yaml were modified? On Sep 9, 9:40 am, Jonathan Lundell jlund...@pobox.com wrote: On Sep 9, 2010, at 6:27 AM, mdipierro wrote: I do not understand where unable to import Rocket comes from. That's a strange error.

Re: [web2py] Re: Routes.py on GAE

2010-09-09 Thread Jonathan Lundell
On Sep 9, 2010, at 7:49 AM, mdipierro wrote: gaehanlder.py does not import Rocket. main imports Rocket Is it possible gaehandler.py or app.yaml were modified? On Sep 9, 9:40 am, Jonathan Lundell jlund...@pobox.com wrote: On Sep 9, 2010, at 6:27 AM, mdipierro wrote: I do not

[web2py] Re: Routes.py on GAE

2010-09-09 Thread mdipierro
try: import rocket except: logging.warn('unable to import Rocket') True. This is supposed to fail on GAE. I will change it. No need to try the import and issue a warning on GAE. On Sep 9, 9:57 am, Jonathan Lundell jlund...@pobox.com wrote: On Sep 9, 2010, at 7:49 AM, mdipierro wrote:

Re: [web2py] Re: Routes.py on GAE

2010-09-09 Thread Jonathan Lundell
On Sep 9, 2010, at 9:17 AM, mdipierro wrote: try: import rocket except: logging.warn('unable to import Rocket') True. This is supposed to fail on GAE. I will change it. No need to try the import and issue a warning on GAE. ...which leaves the mystery of the routes syntax error.

[web2py] web2py windows service problems

2010-09-09 Thread marktie
I tried to execute web2py as windows service, using following command: C:\web2py python web2py.py -W install the response was: web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2010 Version 1.81.5 (2010-07-22 23:56:21) Database drivers available: SQLite3, MSSQL/DB2

[web2py] Re: Parent - Child Models in a single form

2010-09-09 Thread RipRyness
Thinking about this I can't picture it. So do you render the parent- child form on the server? If so do you just render inputs for one child? Or do you pick n number of child forms to render with the parent? I've done parent - child on one form. At least it looked that way to the user. But

[web2py] Re: cherokee problem with fastcgi and uWSGI

2010-09-09 Thread salbefe
Hello, This works fine: uwsgi --pythonpath /var/web2py --module wsgihandler -s /tmp/ we2py.sock --http :9090 If I point to localhost:9090 works ok and I see the welcome application. After that: If I make a config.xml file as is described on http://projects.unbit.it/uwsgi/wiki/Example and I

Re: [web2py] Re: cherokee problem with fastcgi and uWSGI

2010-09-09 Thread Roberto De Ioris
Hello, This works fine: uwsgi --pythonpath /var/web2py --module wsgihandler -s /tmp/ we2py.sock --http :9090 If I point to localhost:9090 works ok and I see the welcome application. After that: If I make a config.xml file as is described on

[web2py] Problem with crud.create and duplicate _formname

2010-09-09 Thread Álvaro J . Iradier
Hi, I think I found a problem (bug?) with crud.create and form.custom.end: I have the following model: db.define_table('contents', Field('name', 'string', required=True, notnull=True, requires=IS_NOT_EMPTY()), Field('ordering', 'integer', required=True, requires=IS_NOT_EMPTY()),

[web2py] sql.as_dict() handling of NULL datetime and other NULLs

2010-09-09 Thread Michele Comitini
Hi Massimo, in sql.py and dal.py def as_dict(self,datetime_to_str=False): d = dict(self) for k in copy.copy(d.keys()): v=d[k] if isinstance(v,Row): d[k]=v.as_dict() elif isinstance(v,Reference): d[k]=int(v)

[web2py] Re: Problem with crud.create and duplicate _formname

2010-09-09 Thread mdipierro
because you cannot .accepts a crud forms. It is implicit. You can do def index(): form = crud.create(db.contents,message='Inserted') return dict(form=form) On Sep 9, 2:51 pm, Álvaro J. Iradier airad...@gmail.com wrote: Hi, I think I found a problem (bug?) with crud.create and

[web2py] Re: Why Django Sucks (slides)

2010-09-09 Thread johntynan
Nice mention of web2py about the application object. I've run into a snag with web2py by not knowing I should have have UUID primary keys... Is this something that could be handled at the web2py level and not within the app/model itself? Would this be similar to what the author means by late

[web2py] Re: Making asynchronous request in web2py

2010-09-09 Thread Michael Ellis
Others may have more experience with this, but it sounds like your example could be handled with a cron job that periodically checks for newly registered users. On GAE, you also have the option to use a task queue. On Sep 9, 7:05 am, Adi aditya.sa...@gmail.com wrote: Hi, I have this test

[web2py] Re: cherokee problem with fastcgi and uWSGI

2010-09-09 Thread salbefe
looking at /var/log/cherokee/error_log that is what I get: [uWSGI] parsing config file /var/web2py/config.xml *** Starting uWSGI 0.9.6 (32bit) on [Thu Sep 9 23:37:45 2010] *** compiled with version: 4.4.4 20100630 (Red Hat 4.4.4-10) Python version: 2.6.4 (r264:75706, Jun 4 2010, 18:20:16) [GCC

Re: [web2py] Re: Why Django Sucks (slides)

2010-09-09 Thread Bruno Rocha
The mention was about web.py not web2py 2010/9/9 johntynan jgty...@gmail.com Nice mention of web2py about the application object. I've run into a snag with web2py by not knowing I should have have UUID primary keys... Is this something that could be handled at the web2py level and not

[web2py] Re: Why Django Sucks (slides)

2010-09-09 Thread mdipierro
Where do you see the reference to web2py in the document. I did not see it. web2py allows for keyed tables (not on all supported database) and a key can be uuid. yes forms will not work well with it (at least I never tried) and web2py was designed with an integer ID in mind. This is not a

[web2py] Re: Making asynchronous request in web2py

2010-09-09 Thread mdipierro
This app http://vizworkshop.cct.lsu.edu/viz2010 Stored here: http://code.google.com/p/hevw/ Does what you asked. Look into the lola function: http://code.google.com/p/hevw/source/browse/models/db.py On Sep 9, 6:05 am, Adi aditya.sa...@gmail.com wrote: Hi, I have this test case:

[web2py] Re: Expando and Polymodel on GAE?

2010-09-09 Thread Dave
Using the test code you provided before, I now get this error: --- Traceback (most recent call last): File C:\Users\Dave\Documents\Python\web2py\gluon\restricted.py, line 188, in restricted exec ccode in environment File

Re: [web2py] Re: cherokee problem with fastcgi and uWSGI

2010-09-09 Thread Roberto De Ioris
looking at /var/log/cherokee/error_log that is what I get: [uWSGI] parsing config file /var/web2py/config.xml *** Starting uWSGI 0.9.6 (32bit) on [Thu Sep 9 23:37:45 2010] *** compiled with version: 4.4.4 20100630 (Red Hat 4.4.4-10) Python version: 2.6.4 (r264:75706, Jun 4 2010,

Re: [web2py] Re: Routes.py on GAE

2010-09-09 Thread Miguel Goncalves
in my case I was using the following routes.py #!/usr/bin/python # -*- coding: utf-8 -*- default_application = 'reviewround' # ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific routes.py default_function = 'index' routes_in = ( ('/',

Re: [web2py] Re: Routes.py on GAE

2010-09-09 Thread Jonathan Lundell
On Sep 9, 2010, at 9:07 PM, Miguel Goncalves wrote: in my case I was using the following routes.py What I'm looking for is the file itself (preferably zipped). I'm wondering if there might be something in it that isn't surviving a paste into email, because I don' t seen anything in line 3 that

[web2py] Re: intercepting SQLFORM delete

2010-09-09 Thread Richard
Wow so fast. Massimo you are amazing! On Sep 9, 11:26 pm, mdipierro mdipie...@cs.depaul.edu wrote: oops. fixed in trunk On Sep 9, 7:50 am, Richard richar...@gmail.com wrote: I want to do some preprocessing before permitting SQLFORM to delete a record: topic = db.topic[topic_id] form

[web2py] Re: How to insert only new items in db as fast as possible?

2010-09-09 Thread Richard
I don't know a good general solution for web2py, but if just targeting GAE: 1) request all existing products 2) find which of your products are new 3) insert new products in a single operation using the GAE API: db.put(list_of_models) And if you have timeouts then break it up with Task Queues.

[web2py] Re: Making asynchronous request in web2py

2010-09-09 Thread Adi
Question: Will the function lola execute in a different thread or something? On Sep 10, 2:50 am, mdipierro mdipie...@cs.depaul.edu wrote: This app    http://vizworkshop.cct.lsu.edu/viz2010 Stored here:    http://code.google.com/p/hevw/ Does what you asked. Look into the lola function:  

[web2py] Re: Making asynchronous request in web2py

2010-09-09 Thread Adi
Want to avoid cron. Crons need to run in a separate web2py instance, and there are some issues we've faced in keeping that alive and running without memory issues. -- Aditya On Sep 10, 2:16 am, Michael Ellis michael.f.el...@gmail.com wrote: Others may have more experience with this, but it

Re: [web2py] Re: intercepting SQLFORM delete

2010-09-09 Thread bally boy
Ya that is true.. Have been following the mailing list closely and will definitely agree with you..Massimo is amazing. In fact Massimo is to web2py what Guido is to python... wow that does sound good! :-) On Fri, Sep 10, 2010 at 9:58 AM, Richard richar...@gmail.com wrote: Wow so fast.

Re: [web2py] Re: Install pyodbc in standalone web2py

2010-09-09 Thread David Mitchell
Thanks Massimo - that'd be very welcome. I've installed pyodbc on several occasions to use with web2py, and it'd be very handy to have it bundled Now about that CouchDB interface... ;- Regards Dave M. On 4 September 2010 02:40, mdipierro mdipie...@cs.depaul.edu wrote: We are considering

[web2py] Re: Problem with crud.create and duplicate _formname

2010-09-09 Thread Álvaro J . Iradier
Thanks Massimo. It's impossible to have better support than web2py, you and this community are impressing, five stars! So, assumming I'm doing other things between the crud.create and the return: def index():    form = crud.create(db.contents,message='Inserted') ... #other code    return