How i can make recursive one to many relation? I want to have
generalized categories like: Programing langauge / High level /
Python, Programing langauge / Low level / C, Programing langauge /
High level / PHP, Programing langauge / Low level / ASM and so on..
I tried to like this, but got an error:
db.define_table('category',
Field('name'),
Field('parent_id', db.category),
Field('info'))
Traceback (most recent call last):
File "/home/giedrius/web2py/gluon/restricted.py", line 178, in
restricted
exec ccode in environment
File "/home/giedrius/web2py/applications/shop/models/db.py", line
74, in <module>
Field('parent_id', db.category),
File "/home/giedrius/web2py/gluon/sql.py", line 537, in __getattr__
return dict.__getitem__(self,key)
KeyError: 'category'
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" 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
-~----------~----~----~----~------~----~------~--~---