[web2py] migrating to postgres error

2011-12-31 Thread Plumo
I have an app working with sqlite. I tried changing to postgres and get this error: class 'psycopg2.ProgrammingError'(syntax error at or near user LINE 3: user INTEGER REFERENCES auth_user(id) ON DELETE CASCADE, ^ ) This is the relevant table: db.define_table('purchase', Field

Re: [web2py] migrating to postgres error

2011-12-31 Thread Marin Pranjić
User is a reserved keyword in postgres, you need to rename field Marin On 31 Dec 2011 09:42, Plumo richar...@gmail.com wrote: I have an app working with sqlite. I tried changing to postgres and get this error: class 'psycopg2.ProgrammingError'(syntax error at or near user LINE 3: user INTEGER

Re: [web2py] migrating to postgres error

2011-12-31 Thread Richard Baron Penman
ah thanks - that was it. I heard a year back the new DAL would take care of these name conflicts. On Sat, Dec 31, 2011 at 6:39 PM, Marin Pranjić marin.pran...@gmail.com wrote: User is a reserved keyword in postgres, you need to rename field Marin On 31 Dec 2011 09:42, Plumo

[web2py] compute field error

2011-12-31 Thread Plumo
I found when I use the compute field I get this error when inserting via appadmin: ProgrammingError: column update specified more than once def now(record): return datetime.datetime.now() db.define_table('upload', Field('data', 'upload', required=True), Field('created',

Re: [web2py] migrating to postgres error

2011-12-31 Thread Anthony
On Saturday, December 31, 2011 7:33:30 AM UTC-5, Plumo wrote: ah thanks - that was it. I heard a year back the new DAL would take care of these name conflicts. You have to set check_reserved: http://web2py.com/books/default/chapter/29/6#Reserved-keywords

[web2py] db filter with orderby argument ERROR

2011-12-31 Thread sungchi
now=time.time() sorts={ 'hot':~db.news.hotness, 'score:~db.news.score, 'new':~db.news.post_time} orderby=sorts[sort] limitby=(50,101) news = db(db.news.post_time(now-25922000.0)).select(limitby=limitby, orderby=orderby) Traceback (most recent call last): File /Users/web2py/gluon/restricted.py,

Re: [web2py] db filter with orderby argument ERROR

2011-12-31 Thread Jonathan Lundell
On Dec 31, 2011, at 8:46 AM, sungchi wrote: now=time.time() sorts={ 'hot':~db.news.hotness, 'score:~db.news.score, 'new':~db.news.post_time} orderby=sorts[sort] limitby=(50,101) news = db(db.news.post_time(now-25922000.0)).select(limitby=limitby, orderby=orderby) Traceback (most

[web2py] Re: Error creating tables on a MySQL database on DotCloud?

2011-12-31 Thread Massimo Di Pierro
Not sure what the problem is but list:reference does work with mysql. Are you sure the table does not exist already? On Dec 30, 10:25 pm, Thomas Dall'Agnese thomas.dallagn...@gmail.com wrote: Hi, After having errors in PostgreSQL, I moved to MySQL and also got errors. With MySQL, I can't

[web2py] Re: compute field error

2011-12-31 Thread Massimo Di Pierro
Your code works for me. What version of web2py? Try it is a newly createted application. On Dec 31, 6:37 am, Plumo richar...@gmail.com wrote: I found when I use the compute field I get this error when inserting via appadmin: ProgrammingError: column update specified more than once def

[web2py] Re: web2py google app engine deployment

2011-12-31 Thread howesc
i believe it is request.env.http_host will give you the domain name that was used to access the site. the appspot domain will never go away, and it will take some time to train the google index to prefer your custom domain. note that in your DNS you can redirect your naked domain to www so

[web2py] Re: db filter with orderby argument ERROR

2011-12-31 Thread sungchi
Thanks Jonathan! But, sort() function When using the limitby using the pagination to be harder. On 1월1일, 오전2시11분, Jonathan Lundell jlund...@pobox.com wrote: On Dec 31, 2011, at 8:46 AM, sungchi wrote: now=time.time() sorts={ 'hot':~db.news.hotness, 'score:~db.news.score,

Re: [web2py] Re: db filter with orderby argument ERROR

2011-12-31 Thread Jonathan Lundell
On Dec 31, 2011, at 4:07 PM, sungchi wrote: Thanks Jonathan! But, sort() function When using the limitby using the pagination to be harder. True. What if you order by (post_time, score) in the request, and then re-sort the result? On 1월1일, 오전2시11분, Jonathan Lundell jlund...@pobox.com

Re: [web2py] Error creating tables on a MySQL database on DotCloud?

2011-12-31 Thread Thomas Dall'Agnese
Hi Massimo, Happy New Year ! Yes, the table doesn't exist. It was named comment and I even renamed it sub_comment to be sure there are no conflicts. If the table exists, the error message is table already exists. I don't know what is error 150 but maybe the problem is due to DotCloud, not

[web2py] Re: db filter with orderby argument ERROR

2011-12-31 Thread sungchi
If I do that limitby range is only in the sort. I want to sort on the entire range. On 1월1일, 오전9시17분, Jonathan Lundell jlund...@pobox.com wrote: On Dec 31, 2011, at 4:07 PM, sungchi wrote: Thanks Jonathan! But, sort() function When using the limitby using the pagination to be harder.

Re: [web2py] Re: db filter with orderby argument ERROR

2011-12-31 Thread Jonathan Lundell
On Dec 31, 2011, at 5:17 PM, sungchi wrote: If I do that limitby range is only in the sort. I want to sort on the entire range. You're right. I can't think of a way to do it in one pass. On 1월1일, 오전9시17분, Jonathan Lundell jlund...@pobox.com wrote: On Dec 31, 2011, at 4:07 PM, sungchi

[web2py] Re: db filter with orderby argument ERROR

2011-12-31 Thread sungchi
As an alternative, news=db(db.news.post_time(now-2592000.0)).select()if sort=='hot': news=news.sort(lambda row: ~row.hotness) [limitby[0]:limitby[1]]if sort=='score': news=news.sort(lambda row: ~row.score)[limitby[0]:limitby[1]] However, this error has occurred. (hotness

Re: [web2py] Re: db filter with orderby argument ERROR

2011-12-31 Thread Jonathan Lundell
On Dec 31, 2011, at 7:41 PM, sungchi wrote: As an alternative, news=db(db.news.post_time(now-2592000.0)).select()if sort=='hot': news=news.sort(lambda row: ~row.hotness) [limitby[0]:limitby[1]]if sort=='score': news=news.sort(lambda row:

[web2py] Re: db filter with orderby argument ERROR

2011-12-31 Thread sungchi
Thanks, Jonathan! It works. On 1월1일, 오후1시11분, Jonathan Lundell jlund...@pobox.com wrote: On Dec 31, 2011, at 7:41 PM, sungchi wrote: As an alternative, news=db(db.news.post_time(now-2592000.0)).select()if sort=='hot': news=news.sort(lambda row: ~row.hotness)

[web2py] Custom col 3 on register form

2011-12-31 Thread Dave
I want to have a comment for the email field of the register form. I did so with: db.auth_user.email.comment = 'custom comment' But now that comment is showing across all auth forms (login, reset password, etc.). I currently have the auth formstyles set to divs but there is nothing to

[web2py] Re: Custom col 3 on register form

2011-12-31 Thread Anthony
Assuming you're using the standard user() function: def user(): if request.args(0) == 'register': db.auth_user.email.comment = 'custom comment' return dict(form=auth()) So, the comment is only set when the 'register' action is requested. Anthony On Saturday, December 31, 2011

Re: [web2py] Re: Custom col 3 on register form

2011-12-31 Thread Javier Quarite
Anthony, its 2012! Happy new year! :) (Sorry for doing this here but he, Massimo and everyone that helps in this group deserves it) Javier

[web2py] Re: Error creating tables on a MySQL database on DotCloud?

2011-12-31 Thread Massimo Di Pierro
let us know if you find out more. On Dec 31 2011, 7:07 pm, Thomas Dall'Agnese thomas.dallagn...@gmail.com wrote: Hi Massimo, Happy New Year ! Yes, the table doesn't exist. It was named comment and I even renamed it sub_comment to be sure there are no conflicts. If the table exists, the

[web2py] Happy new year

2011-12-31 Thread Massimo Di Pierro
Happy new year everybody!