[web2py] New app, now what? Best practices for dev workflow

2010-01-15 Thread hcvst
Hi, I started to use web2py in Jan 2009 and had a lot of fun using and learning it (and Python) the last year. However I also acquired a lot of habits that are probably not ideal. For example, after creating a new app, I would often remove most of the generated files rather than using them as the

[web2py] Autoincrement field

2010-01-15 Thread ceriox
hi all, i need an autoincremented unic numeric field for make a ticket system how i can do it? thanks for help -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this

[web2py] Re: jQuery 1.4 out

2010-01-15 Thread Anand Vaidya
I downloaded and overwrote static/jquery.js with the 1.4 version. w2p seems to work fine, atleast nothing glaring failure... Regards Anand On Jan 15, 3:48 pm, Jake j2g...@gmail.com wrote: http://jquery14.com/day-01/jquery-14 cool! -- You received this message because you are subscribed to

[web2py] mercurial.py : ignore sessions too

2010-01-15 Thread Anand Vaidya
Massimo, applications/admin/controller/mercurial.py should add sessions/* to the .hgignore file. We don't need to place the sessions files in VCS Regards Anand -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to

Re: [web2py] Re: Getting representation from two levels deep relation

2010-01-15 Thread Miguel Lopes
On Thu, Jan 14, 2010 at 3:26 PM, mdipierro mdipie...@cs.depaul.edu wrote: I think all the problems arise from the fact that you do: IS_IN_DB(db(db.opportunity.id==db.task.opportunity_id),...) this is a join and you cannot do a JOIN in a validator because you are referencing one table,

Re: [web2py] Re: how calculate field total

2010-01-15 Thread Alexandre Andrade
Massimo, Maybe the problem with .compute in my table is that implements audit trail' pattern (web2pyslices). I don't know how 'compute' works, but the fact of 'audit trail' tables the id is not unique can make it fail. thanks for the help, but the proposed solution returns a invalid sintax

Re: [web2py] validating an empty select

2010-01-15 Thread Alexandre Andrade
db.task.contact_id.requires=IS_NULL_OR(IS_IN_DB(db,'contact.id','%(name)s')) do what you want 2010/1/15 Miguel Lopes mig.e.lo...@gmail.com I have a select field on a form. It might be empty or take one related value. I the model:

Re: [web2py] validating an empty select

2010-01-15 Thread Miguel Lopes
On Fri, Jan 15, 2010 at 1:17 PM, Alexandre Andrade alexandrema...@gmail.com wrote: db.task.contact_id.requires=IS_NULL_OR(IS_IN_DB(db,'contact.id ','%(name)s')) do what you want Not really. It works if there are already records in db.contact related to the task. But in there aren't any I

[web2py] Re: Postgres EXEPTION in web2py

2010-01-15 Thread mdipierro
I do not know. As I said web2py does not get in the way. I do not know what psycopg2 does. I would ask the authors. On Jan 15, 1:37 am, haftish21 haftis...@gmail.com wrote: This is to mean, what is called is a database function which has no return value but raises an exception when sth is wrong

[web2py] Re: Large datasets

2010-01-15 Thread mdipierro
This is ok for small datasets. No way to make it scale. I would use some tricks using ListPropery. On GAE really everything depends on details. On Jan 15, 3:34 am, toan75 toa...@gmail.com wrote: Thank mdipierro. But i want use find on GAE:         rows = db(db.cat.id0).select()         rows =

[web2py] Re: jQuery 1.4 out

2010-01-15 Thread mdipierro
Let's wait 1.4.1 (which I am sure will follow soon) and we'll upgrade. On Jan 15, 5:11 am, Anand Vaidya anandvaidya...@gmail.com wrote: I downloaded and overwrote static/jquery.js with the 1.4 version. w2p seems to work fine, atleast nothing glaring failure... Regards Anand On Jan 15, 3:48 

[web2py] Re: mercurial.py : ignore sessions too

2010-01-15 Thread mdipierro
right. thanks. On Jan 15, 5:19 am, Anand Vaidya anandvaidya...@gmail.com wrote: Massimo, applications/admin/controller/mercurial.py should add sessions/* to the .hgignore file. We don't need to place the sessions files in VCS Regards Anand -- You received this message because you are

[web2py] Re: Help, What this mean?

2010-01-15 Thread mdipierro
Does your app have write access to the applications folder? On Jan 14, 11:37 pm, drayco antrod...@gmail.com wrote: which web2py version? 1.7.6 Can you try delete everything in the cache folder of your application? No, I just Install and I try to run it for the first time I try to use the

Re: [web2py] Re: validating an empty select

2010-01-15 Thread Miguel Lopes
On Fri, Jan 15, 2010 at 2:00 PM, DenesL denes1...@yahoo.ca wrote: Does the error occur on the 'empty' option of the select?. You are introducing a 0 index value which is invalid in the db Yes. You are right! But how can I have a select with an empty option. Please note the following extra

[web2py] Re: Anybody going to PyCon?

2010-01-15 Thread mdipierro
I participated in the review process. The process is fair and the people are smart but the rules are the problem. Say for example 51% of reviewers are pro A (against B) and 49% are pro B (against A). If everybody votes on each of 100 items where each item can be associated to A or B uniquely, all

[web2py] Re: validating an empty select

2010-01-15 Thread DenesL
Hi Miguel, contact_set=dict([(contact.id,contact.name) for contact in contacts]) and in your controller override your requires: db.task.contact_id.requires=IS_EMPTY_OR(IS_IN_SET (contact_set,zero=None)) note that you can use SQLFORM too here: form=SQLFORM(db.task,fields=['contact_id',...])

[web2py] reset_password

2010-01-15 Thread Wes James
Massimo, I just tested the reset_password again and it is working fine. I had some code to remove the /user/ part of some of your functions process. I put it back in for reset_password and it is all working great. Thank you very much for getting this in to w2p!! -wes -- You received this

Re: [web2py] Autoincrement field

2010-01-15 Thread Thadeus Burgess
Field('mysecondaryid', 'integer', default=db.table.mysecondaryid + 1) should work. -Thadeus On Fri, Jan 15, 2010 at 7:14 AM, Alexandre Andrade alexandrema...@gmail.com wrote: by default, web2py creates a 'id' field, it is autoincremented. 2010/1/15 ceriox cer...@gmail.com hi all, i

[web2py] Re: Auth on GAE silently fails to login

2010-01-15 Thread Carl
hi I gotten down to the area that's tripping up. My app will login correctly if I comment out the following lines; I've put those commented lines in context below... FILE: models/dp.py db.define_table('iso3166', SQLField('country', 'string', length=128, required=True),

[web2py] Re: reset_password

2010-01-15 Thread mdipierro
I just posted a new version in trunk. I split the process in two actions request_reset_password and reset_password. This allows more customization and cleaner code. Would you please check it once more? Massimo On Jan 15, 10:17 am, Wes James compte...@gmail.com wrote: Massimo, I just tested

Re: [web2py] Re: Anybody going to PyCon?

2010-01-15 Thread Thadeus Burgess
I don't understand it, but for some reason django users really dislike web2py, and attack it almost like we're the Christians of the python world. -Thadeus On Fri, Jan 15, 2010 at 8:35 AM, mdipierro mdipie...@cs.depaul.edu wrote: I participated in the review process. The process is fair and

[web2py] Re: Autoincrement field

2010-01-15 Thread mdipierro
No it will not. On Jan 15, 10:32 am, Thadeus Burgess thade...@thadeusb.com wrote: Field('mysecondaryid', 'integer', default=db.table.mysecondaryid + 1) should work. -Thadeus On Fri, Jan 15, 2010 at 7:14 AM, Alexandre Andrade alexandrema...@gmail.com wrote: by default, web2py creates

Re: [web2py] Re: Auth on GAE silently fails to login

2010-01-15 Thread Thadeus Burgess
Please post to pastebin instead ??? -Thadeus On Fri, Jan 15, 2010 at 10:38 AM, Carl carl.ro...@gmail.com wrote: hi I gotten down to the area that's tripping up. My app will login correctly if I comment out the following lines; I've put those commented lines in context below... FILE:

Re: [web2py] Re: Autoincrement field

2010-01-15 Thread Thadeus Burgess
Duh, my bad Here follow this post http://groups.google.com/group/web2py/browse_thread/thread/7c801d48d456871f/7263df4d37211f53?lnk=gstq=31704#7263df4d37211f53 -Thadeus On Fri, Jan 15, 2010 at 10:46 AM, mdipierro mdipie...@cs.depaul.edu wrote: No it will not. On Jan 15, 10:32 am,

[web2py] Hiding a field

2010-01-15 Thread kbochert
Is it possible to use SQLFORM to generate forms which show different fields? I.E. I have a model: db.define_table('client', Field('uid', auth_user), Field('name', 'string'), migrate = 'client.table' ) I want a page which the client uses that hides the 'uid' field, which gets

[web2py] Re: Anybody going to PyCon?

2010-01-15 Thread mdipierro
LOL. I do understand them. They have invested time and money in Django and think web2py is stealing users from them. Instead I think the future of Django and web2py is very much correlated because, although in competition, they have lots of similarities and their fate is very much tied to

Re: [web2py] Re: Auth on GAE silently fails to login

2010-01-15 Thread Carl
I made the changes you listed but the failed login still persists (you probably expected it to but I was forever hopeful! :) I'll see if I can create a small app that replicates the issue and send it to you. thanks for your time. 2010/1/15 mdipierro mdipie...@cs.depaul.edu I do not know why

[web2py] Re: Hiding a field

2010-01-15 Thread mdipierro
You can change db.client.uid.readbale=True or False where you need it, for example in the action before form=. Massimo On Jan 15, 11:08 am, kbochert kboch...@copper.net wrote: Is it possible to use SQLFORM to generate forms which show different fields? I.E. I have a model:

[web2py] Re: Auth on GAE silently fails to login

2010-01-15 Thread mdipierro
I see a lot of orderby in those validators that create problems. I think the problem is there. Try remove the orderby and see if the error goes away. If it does there are two options: 1) you need an index 2) the query is somehow invalid on GAE Massimo On Jan 15, 11:17 am, Carl

Re: [web2py] Re: reset_password

2010-01-15 Thread Wes James
Seems to be working. There is no doc string for request_reset_password and there is no flash message after putting in the email and submitting - to the regard Email sent. I tried to find out why, I'll look some more with wingide. thx, -wes On Fri, Jan 15, 2010 at 9:44 AM, mdipierro

[web2py] Re: Hiding a field

2010-01-15 Thread kbochert
No good. It hides the field correctly but again after: form.vars.uid = 2 # set the uid explicitly the call db.client.insert(**dict(form.vars)) complains that 'uid' is an invalid field name It appears that SQLFORM is just not prepared to accept a field that it didn't display. Karl On

[web2py] Re: jQuery 1.4 out

2010-01-15 Thread waTR
I much prefer YUI 3 over Jquery 1.4... YUI 3 is not only smaller (7k + plugins you choose to use), but it is also a tighter package, and has a great set of features (CUSTOME EVENTS!!). Congrats to the jQuery team non-the-less, the world still needs jQuery. On Jan 15, 6:16 am, mdipierro

[web2py] Re: Looking for simple Javascript JSON-RPC call to web2py server

2010-01-15 Thread MrGrieves
I've posted a slice explaining my approach here: http://www.web2pyslices.com/main/slices/take_slice/48 Cheers Mark On Dec 23 2009, 10:12 am, mdipierro mdipie...@cs.depaul.edu wrote: Thank you. If you have time, would you post a web2pyslice about this? Massimo On Dec 23, 10:36 am,

[web2py] Re: Hiding a field

2010-01-15 Thread mdipierro
What is the traceback? Is this an OperationalError or RuntimeError. It is possible that the database does not like the field name 'uid'. I do not think this is a web2py error. On Jan 15, 11:35 am, kbochert kboch...@copper.net wrote: No good. It hides the field correctly but again after:    

[web2py] Re: Anybody going to PyCon?

2010-01-15 Thread mikech
Still, I notice that the registration form is still web2py. I am disappointed in the diversity of topics in relation to Web Frameworks. One would think there is only Django. I look at these conferences as an opportunity to see many different approaches to the same issues, and thus get fresh

[web2py] Re: Anybody going to PyCon?

2010-01-15 Thread mdipierro
I agree. For example they offer basically 3 tutorials on Django (intro, advanced, pinax) and one on Repoze (has anybody tried it?) but rejected tutorial proposals for both web2py and TG. I find it odd because I think they should try to offer broader coverage in order to attract more people.

[web2py] Re: reset_password

2010-01-15 Thread mdipierro
You should not have this: {{if response.flash or session.flash:}} div class=flash{{=response.flash if response.flash else session.flash}}/div {{pass}} This breaks the web2oy flash mechanism. This is the correct thing: div class=flash{{=response.flash}}/div session.flash is

[web2py] Re: Hiding a field

2010-01-15 Thread kbochert
Error traceback Traceback (most recent call last): File gluon/restricted.py, line 173, in restricted File E:/web2py/applications/mug/controllers/admin.py, line 325, in module File E:/web2py/applications/mug/models/db.py, line 139, in filter File gluon/tools.py, line 1664, in f File

Re: [web2py] Re: Auth on GAE silently fails to login

2010-01-15 Thread Carl
I've taken out the orderby clauses but the login failure still happens (I've had those clauses in for earlier versions of web2py but it was worth looking). Perhaps these two statements (default.py in user() ) are the issue on GAE? db.auth_user.billing_country.requires = IS_NULL_OR(IS_NOT_EMPTY())

[web2py] Re: Hiding a field

2010-01-15 Thread mdipierro
On Jan 15, 12:13 pm, kbochert kboch...@copper.net wrote: Error traceback Traceback (most recent call last):   File gluon/restricted.py, line 173, in restricted   File E:/web2py/applications/mug/controllers/admin.py, line 325, in module   File E:/web2py/applications/mug/models/db.py, line

[web2py] Re: Auth on GAE silently fails to login

2010-01-15 Thread mdipierro
One more test. What bothers me is that is works on dev_appserver but not when deployed. There must be some corrupted data in the database. Is it an option for you to delete all data on GAE? On Jan 15, 12:22 pm, Carl carl.ro...@gmail.com wrote: I've taken out the orderby clauses but the login

Re: [web2py] Re: validating an empty select

2010-01-15 Thread Miguel Lopes
On Fri, Jan 15, 2010 at 3:20 PM, DenesL denes1...@yahoo.ca wrote: Hi Miguel, contact_set=dict([(contact.id,contact.name) for contact in contacts]) and in your controller override your requires: db.task.contact_id.requires=IS_EMPTY_OR(IS_IN_SET (contact_set,zero=None)) note that you can

Re: [web2py] Re: Anybody going to PyCon?

2010-01-15 Thread Joe Barnhart
Exactly. I have not planned to attend PyCon because it has limited coverage of topics and none of the topics covered hit my hot button. When you expand the diversity of coverage, you hit more hot buttons in more people and attendance goes up. They might as well re-label this DjangoCon. On Fri,

Re: [web2py] Re: reset_password

2010-01-15 Thread Wes James
I must have done that at some point when I was trying to remove /user/ from the path (maybe routes would be batter for that) Anyway I put the code back to: {{if response.flash:}} div class=flash{{=response.flash}}/div {{pass}} but there is no message. I'll peak at this with wingide.

[web2py] Re: Hiding a field

2010-01-15 Thread kbochert
Fixed. In my playing around I had tried passing a field list to SQLFORM. I had gotten db.client.fields, and used a subroutine to remove 'userid' from the list. Of course db.client.fields was passed by reference... Thanks again Karl On Jan 15, 11:31 am, mdipierro mdipie...@cs.depaul.edu

[web2py] Re: Hiding a field [solved]

2010-01-15 Thread mdipierro
Thanks for letting us know. :-) On Jan 15, 2:22 pm, kbochert kboch...@copper.net wrote: Fixed. In my playing around I had tried passing a field list to SQLFORM. I had gotten db.client.fields, and used a subroutine to remove 'userid' from the list. Of course db.client.fields was passed by

[web2py] Re: reset_password

2010-01-15 Thread mdipierro
the lack of messages, every time I have seen it, it was always caused by a double redirect. Are you using user() action or custom login/ logout/etc actions? On Jan 15, 2:15 pm, Wes James compte...@gmail.com wrote: I must have done that at some point when I was trying to remove /user/ from the

Re: [web2py] Re: Auth on GAE silently fails to login

2010-01-15 Thread Carl
I had deleted GAE's tables before contacting you; I've just deleted them again but I get the same behaviour. There is perhaps a subtle difference between dev_appserver and the real-deal GAE. I'll put together a stand-alone app tomorrow. 2010/1/15 mdipierro mdipie...@cs.depaul.edu One more

[web2py] migration reboot

2010-01-15 Thread Jeff Bauer
Automatic database migration in web2py is great. However, after a few dozen iterations during development, I'd like to 'reboot' through all the cruft and set database fields to agree with my models. I'm aware that I could go through and set migration=False, but that's not what I'm looking for.

[web2py] Re: migration reboot

2010-01-15 Thread mdipierro
On Jan 15, 3:24 pm, Jeff Bauer jeffru...@gmail.com wrote: Automatic database migration in web2py is great.  However, after a few dozen iterations during development, I'd like to 'reboot' through all the cruft and set database fields to agree with my models.  I'm aware that I could go through

Re: [web2py] Re: reset_password

2010-01-15 Thread Wes James
I created a new app and forgot I had: auth.settings.verify_email_next = '/app/default/login' and it went to my apps page (one I've been getting no messages on) with no message. I then clicked on the back button and it when to the default default/user/login for the test app I was working on and

Re: [web2py] Re: reset_password [SOLVED]

2010-01-15 Thread Wes James
found it. I didn't use auth.settings.request_reset_password_next = '/app/default/login' and it was getting a double redirected through /user/ and I was thinking I was getting around /user/ - missed this one. thx, -wes On Fri, Jan 15, 2010 at 2:37 PM, Wes James compte...@gmail.com wrote: I

[web2py] settting two vars to same text

2010-01-15 Thread Wes James
This seems to work, but is there a better way to set some vars to the same value? auth.settings.verify_email_next = auth.settings.request_reset_password_next ='/app/default/login' Is this a good technique or keep vars=value on the same line? thx, -wes -- You received this message because you

[web2py] web2py showcase?

2010-01-15 Thread eka
Is there a list of sites powered by web2py? Like http://www.djangosites.org/ or a list somewhere? Regards -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this

Re: [web2py] settting two vars to same text

2010-01-15 Thread Jonathan Lundell
On Jan 15, 2010, at 2:26 PM, Wes James wrote: This seems to work, but is there a better way to set some vars to the same value? auth.settings.verify_email_next = auth.settings.request_reset_password_next ='/app/default/login' Is this a good technique or keep vars=value on the same line?

Re: [web2py] settting two vars to same text

2010-01-15 Thread Wes James
hmm - yes... maybe: login_page = URL(r=request,c='default',f='login') auth.settings.verify_email_next = login_page auth.settings.request_reset_password_next = login_page thx, -wes On Fri, Jan 15, 2010 at 3:37 PM, Jonathan Lundell jlund...@pobox.com wrote: On Jan 15, 2010, at 2:26 PM, Wes

Re: [web2py] settting two vars to same text

2010-01-15 Thread Jeff Bauer
On Jan 15, 2010, at 2:26 PM, Wes James wrote: This seems to work, but is there a better way to set some vars to the same value? auth.settings.verify_email_next = auth.settings.request_reset_password_next ='/app/default/login' Is this a good technique or keep vars=value on the same line? The

Re: [web2py] Re: migration reboot

2010-01-15 Thread Jeff Bauer
On 01/15/2010 03:36 PM, mdipierro wrote: On Jan 15, 3:24 pm, Jeff Bauerjeffru...@gmail.com wrote: Use case: When I access my database outside of DAL, I've got a bunch of old columns that are no longer in use. I assume you use sqlite. sqlite cannot drop columns.With a different database (if

Re: [web2py] settting two vars to same text

2010-01-15 Thread Jonathan Lundell
On Jan 15, 2010, at 2:42 PM, Wes James wrote: hmm - yes... maybe: login_page = URL(r=request,c='default',f='login') auth.settings.verify_email_next = login_page auth.settings.request_reset_password_next = login_page Right. That has the additional advantage that routes.py gets to see it.

Re: [web2py] web2py showcase?

2010-01-15 Thread Thadeus Burgess
http://web2py.com/poweredby and http://www.appliedstacks.com/NewestFirst/web2py -Thadeus On Fri, Jan 15, 2010 at 4:28 PM, eka ekagauranga...@gmail.com wrote: Is there a list of sites powered by web2py? Like http://www.djangosites.org/ or a list somewhere? Regards -- You received

[web2py] Re: migration reboot

2010-01-15 Thread kbochert
How about: 1. Save the database with db.export_to_csv_file(open('somefile.csv', 'wb')) -- The csv file should only contain columns defined in the current database. I have not checked this - seems reasonable. 2. Erase the entire contents of applications\myapp\databases -- This includes the

[web2py] Re: web2py showcase?

2010-01-15 Thread eka
Thanks for that. On Jan 15, 9:16 pm, Thadeus Burgess thade...@thadeusb.com wrote: http://web2py.com/poweredby and http://www.appliedstacks.com/NewestFirst/web2py -Thadeus On Fri, Jan 15, 2010 at 4:28 PM, eka ekagauranga...@gmail.com wrote: Is there a list of sites powered by web2py?

[web2py] Bulk inserts in Google App Engine

2010-01-15 Thread Jon Romero
Is there any way to do bulk inserts in GAE? Check here number 5 (http://googleappengine.blogspot.com/2009/06/10- things-you-probably-didnt-know-about.html) -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to