I did this which should suffice
If only I could display the name of the category_cat though :-?
Any ideas
Field('category', db.category, requires=IS_IN_DB(db,db.category.id,'%(name)s
- %(category_cat)s',multiple=True)),
On Wed, Sep 12, 2012 at 11:29 AM, A E <[email protected]> wrote:
> I have defined three tables
>
> db.define_table('category_cat',
> Field('userinfo',db.auth_user,default=auth.user_id,
> writable=False,readable=False),
> Field('name', requires=IS_NOT_EMPTY()))
>
> db.define_table('category',
> Field('userinfo',db.auth_user,default=auth.user_id,
> writable=False,readable=False),
> Field('category_cat',db.category_cat,requires=IS_IN_DB(db,
> db.category_cat.id,'%(name)s')),
> Field('name', label='Sub Category', requires=IS_NOT_EMPTY()),
> Field('description', 'text'))
>
> db.define_table('listing',
> Field('userinfo',db.auth_user,default=auth.user_id,
> writable=False,readable=False),
> Field('category', db.category, label='Category * ~can select
> multiple~', requires=IS_IN_DB(db,db.category.id
> ,'%(name)s',multiple=True)),
>
>
> I would like to display the category_cat entries in the Multi Select Form
> Field (for the listings table) make them unselectable and group the
> category entries under each one is this even possible? If so how can I
> achieve this result
>
> So for example in the Multi Select Form (listing table) I would like to
> have
>
> category_cat 1 (not selectable)
> category 1
> category 2
> category_cat 2 (not selectable)
> category 3
> category 4
>
> but displaying the name value :-)
>
> I hope I made sense and some one can help me :-)
>
> Thank you
>
>
>
--