I was not clear at all I realized:

I have 3 tables

Category
Sub category
and Listings

Sub Category uses IS_IN_DB form the category table and listings uses
IS_IN_DB from the Sub category table

In the listings field I would like to display the Top Category then the sub
category in the Multiple Select List and group each of them according using
SQLForm

Category 1 (just black text)
   Subcategory 1
   Subcategory 2
Category 2 (just black text)
   Subcategory 1

   I want to appear similar to this in the


*cheers and ty




On Tue, Sep 11, 2012 at 4:12 PM, A E <hiweb...@gmail.com> wrote:

> How can I display the top level category name and group the entries that
> are under it in my form that uses IS_IN_DB
>
> For example the category field is top level
>
> db.define_table('category',
>     Field('userinfo',db.auth_user,default=auth.user_id,
> writable=False,readable=False),
>     Field('name', label='Sub Category', requires=IS_NOT_EMPTY()),
>     Field('description', 'text'))
>
> I would like to use SQLForm and group each entry under its respective
> category entry
>
> 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)),
>
>  *cheers
>
> and ty
>
>
>

-- 



Reply via email to