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)
thank you very much in advance