Thanks, but I'm a little uncertain how to get the list of groups, I
tried `if request.controller in
db(db.group_of_events).select(orderby=db.group_of_events.group_name)`,
but that didn't work.

Here's an extremely simplified version of my tables (if that's of help):

db.define_table(
    'group_of_events',
    Field('group_name', notnull=True, requires=[IS_NOT_IN_DB(db,
'group_of_events.group_name'), IS_SLUG()]),
    format='%(group_name)s'
)

db.define_table(
    'event',
    Field('event_name', notnull=True),
    Field('group_id', 'reference db.group_of_events', notnull=True,
requires=IS_IN_DB(db, db.group_of_events, '%(group_name)s')),
    format='%(event_name)s'
)


On Sat, Jul 21, 2012 at 5:03 AM, Bruno Rocha <rochacbr...@gmail.com> wrote:
> I dont know if it is a bug or feature (but I like it), you can do it in
> models!
>
> models/0_routing.py
>
> if request.controller in MYLISTOFGROUPS:
>     groupslug = str(request.controller) # here you can use deep copy or just
> str()
>     request.controller = 'group'
>     request.function = 'show'
>     request.args[0] = groupslug
>
>
> controllers/group.py
>
> def show()
>     group = db(db.groups.slug==request.args(0)).select()
>      return dict(group=group)
>
> --
>
>
>

-- 



Reply via email to