I have an item ,category and item_category tables facilitating many to
many relations between items and categories, which enables an item to
belongs to several categories. I use SQLSmartgrid to show the
item_category table and to add categories to specific item. This all works
well. I can even managed to get an error if I select an already selected
category by using the following:
db.item_category.category.requires = IS_IN_DB(db, 'category', '%(name)s',
_and=IS_NOT_IN_DB(db, 'item_category.category', error_message=T('This category
already assigned')), zero=None)
So what more could I wish ?
It would be nice if the category dropdown list I get when adding or editing
category to an item would contains only the categories not yet assigned to the
item I am working on
At the moment I get a list with all categories, however selecting an existing
category correctly give me an error as described above.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/d/optout.