hi,
i want to create category and sub category table using self-reference. when
i create the table it's seems normal (i've checked in sql.log) :
CREATE TABLE category_archive(
id INTEGER PRIMARY KEY AUTOINCREMENT,
category CHAR(10) NOT NULL UNIQUE,
* parent INTEGER REFERENCES category (id) ON DELETE CASCADE,*
is_active CHAR(1),
created_on TIMESTAMP,
created_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
modified_on TIMESTAMP,
modified_by INTEGER REFERENCES auth_user (id) ON DELETE CASCADE,
current_record INTEGER REFERENCES category (id) ON DELETE CASCADE
);
and here is in model : db.py
db.define_table('category',
Field('category', length=10, notnull=True, unique=True),
Field('parent', 'reference category'),
format='%(category)s')
the problem is when i want to fill the form the parent field is not showing
drop down, even in database administration too, is it normal or there is
something wrong in my code?
note:
i've tried the others table that using reference to another table it's work
fine (showing drop down in form field)
i've tried to copas from book
http://web2py.com/books/default/chapter/29/06#Self-Reference-and-aliases the
result is same too (not showing drop down in form field even in database
administration too)
thank you very much in advance
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.