On Friday 27 August 2010 7:24:13 pm mdipierro wrote:
> try this:
>
> from guon.sql import Expression
For those following along: from gluon.sql import Expression
> db.define_table(.....,Field(...,default=Expression('CURRENT_DATE')),....)
>
> On
I tried the above and got:
Traceback (most recent call last):
File "/home/aklaver/software_projects/w2py/web2py/gluon/restricted.py", line
186, in restricted
exec ccode in environment
File
"/home/aklaver/software_projects/w2py/web2py/applications/hplc/models/db.py",
line 111, in <module>
Field('date_default','date',default=Expression('CURRENT_DATE'),required=True,notnull=True),
File "/home/aklaver/software_projects/w2py/web2py/gluon/sql.py", line 2746,
in
__init__
self.default = default==None and update or default
File "/home/aklaver/software_projects/w2py/web2py/gluon/sql.py", line 2548,
in
__eq__
return Query(self, '=', value)
File "/home/aklaver/software_projects/w2py/web2py/gluon/sql.py", line 2972,
in
__init__
left._db._translator['is null'])
AttributeError: 'NoneType' object has no attribute '_translator'
--
Adrian Klaver
[email protected]