I think from is a SQL keyword therefore it cannot be a field name. You
do not need db.commit() in models.

On May 4, 10:49 pm, mart <msenecal...@gmail.com> wrote:
> Hi,
>
> I think I may have been looking at this too long... its giving the
> following error, and I can't see why...
> (using DAL in script)
>
> Thanks in advance,
> Mart :)
>
>         db.define_table('mail',
>             Field('uuid',length=64,default=uuid.uuid4()),
>             Field('recipients','list:string'),Field('From'),
>             Field('password'),Field('smtp_server'),Field('smtp_port'))
>         db.commit()
>
> Traceback (most recent call last):
>   File "/Users/mart/Applications/Aptana Studio 2.0/plugins/
> org.python.pydev.debug_1.6.5.2011020317/pysrc/pydevd.py", line 1133,
> in <module>
>     debugger.run(setup['file'], None, None)
>   File "/Users/mart/Applications/Aptana Studio 2.0/plugins/
> org.python.pydev.debug_1.6.5.2011020317/pysrc/pydevd.py", line 918, in
> run
>     execfile(file, globals, locals) #execute the script
>   File "/Users/mart/aptanaApps/src/_purple.py", line 524, in <module>
>     dbBlueObj.defineTables()
>   File "/Users/mart/aptanaApps/src/blueLite/db_storage/db_blue.py",
> line 278, in defineTables
>     Field('password'),Field('smtp_server'),Field('smtp_port'))
>   File "/Users/mart/aptanaApps/src/blueLite/pyUtils/sql/web2py/
> dal.py", line 4028, in define_table
>     polymodel=polymodel)
>   File "/Users/mart/aptanaApps/src/blueLite/pyUtils/sql/web2py/
> dal.py", line 590, in create_table
>     self.create_sequence_and_triggers(query,table)
>   File "/Users/mart/aptanaApps/src/blueLite/pyUtils/sql/web2py/
> dal.py", line 1142, in create_sequence_and_triggers
>     self.execute(query)
>   File "/Users/mart/aptanaApps/src/blueLite/pyUtils/sql/web2py/
> dal.py", line 1152, in execute
>     return self.log_execute(*a, **b)
>   File "/Users/mart/aptanaApps/src/blueLite/pyUtils/sql/web2py/
> dal.py", line 1147, in log_execute
>     ret = self.cursor.execute(*a,**b)
> sqlite3.OperationalError: near "From": syntax error

Reply via email to