On your second question, you should use alternate notation:
db.define_table("location_unit)",
SQLField("name", "string", notnull=True),
SQLField("parentLocation", "reference location_unit"),
)
See http://web2py.com/book/default/section/6/13 for details.
As for your first question, please show us you model code.
On May 26, 5:15 am, Neveen Adel <[email protected]> wrote:
> Hello,
>
> i have a problem in the creation of new database
>
> I wrote my design into db.py :
>
> and then i run my application the tables was created only in
> "appadmin", but when i show tables into mysql it displayed an empty
> set.
>
> then any update in the tables it cause
> "
> ProgrammingError: (1146, "Table 'MLD.user' doesn't exist")
> "
>
> so any one have any idea what is the problem?
>
> The second issue :
>
> i have a table and i want to make a relation to itself?
>
> as :
>
> db.define_table("location_unit)",
> SQLField("name", "string", notnull=True),
> SQLField("parentLocation", db.location_unit),
> )
> it cause "
> return dict.__getitem__(self,key)
> KeyError: 'location_unit'
> "
>
> Please could any one help me ??
>
> Thanks