Johannes is right (try another name for the fields field) yet the line
of the error does not exist in my copy of dal.py. Also try a newer
web2py version, you may get no error, or a better description of the
problem.

Massimo

On Jul 27, 6:07 am, François Le Gal <[email protected]> wrote:
> That's the code i try :
>
> db_system = SQLDB("sqlite://db_system.db")
>
> db_system.define_table("fields",Field("name"))
> db_system.define_table("objects",Field("name"),Field("fields",db_system.fie 
> lds))
>
> But when i execute this code, i got this error :
>
> File "/home/fanch/Logiciels/web2py/gluon/dal.py", line 4228, in
> define_table
>     t._create_references()
>   File "/home/fanch/Logiciels/web2py/gluon/dal.py", line 4536, in
> _create_references
>     field=self[fieldname]
>   File "/home/fanch/Logiciels/web2py/gluon/dal.py", line 4592, in
> __getitem__
>     return dict.__getitem__(self, str(key))
> KeyError: 'SUBSTR(objects.fields,1,(2 - 1))'
>
> What's wrong ? Any idea ?
>
> thanks.

Reply via email to