On Fri, Apr 24, 2009 at 4:18 PM, Jurgis Pralgauskis < [email protected]> wrote:
> > ok, thanks, seems it was double error :) > by the way > > > timestamp is a reserved keywork in SQL and cannot be used as a field > > name. > > it would be good for folks in my situation to see similar exeption :) This really needs to come from the db backend; depending on the version of SQL implemented, on proprietary keywords, etc.... There are strategies you can take to circumvent such problems. Even though this is a Postgres document, it does provide a useful summary and general reference. See: http://www.postgresql.org/docs/8.3/interactive/sql-keywords-appendix.html Notice that various db servers try to be more flexible than the various SQL standards. > > > by the way, how I assign now() as default value in datetime type? > didn't find this in examples.. (again thanks in advance:) The concept is: db.mytable.my_datetime.default=now() or in the table definition: .... db.Field('my_datetime', date, default=datetime.now()) See http://docs.python.org/library/datetime.html for more... > > > > On Apr 24, 9:53 am, Wes James <[email protected]> wrote: > >> On Fri, Apr 24, 2009 at 7:39 AM, Jurgis Pralgauskis > >> > >> <[email protected]> wrote: > >> > >> > hello, > >> > >> <snip> > >> > >> > >> > >> > and don't get the error, if I do > >> > >> > db.define_table("items", > >> > SQLField("progwww", "string", ), > >> > SQLField("importance", "integer"), > >> > SQLField("about", "text", ), > >> > #SQLField("timestamp", "date"), > >> > ) > >> > >> I don't get the error if I change tablename from items to items0. The > >> timestamp field was fine for me. There must be an attribute in the > >> core somewhere called "items" > >> > >> -wj > > > > > > > > > -- > Jurgis Pralgauskis > tel: 8-616 77613; > jabber: [email protected]; skype: dz0rdzas; > Don't worry, be happy and make things better ;) > http://sagemath.visiems.lt > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

