Hi every one! Again me, this time I have a little issue with this:

I have the model:

db.define_table('location',
         Field('name','string'))

db.define_table('room',
         Field('name','string'),
         Field('isbooked','boolean'),
         Field('location_id', db.location))

db.define_table('categorie',
         Field('name','string'))

db.define_table('member',
         Field('name','string'),
         Field('categorie_id',db.categorie))

db.define_table('booking',
         Field('room_id',db.room),
         Field('member_id',db.member),
         Field('date','datetime'),
         Field('comment','text'))


and what I need is this:

A user can make a booking with multiple rooms, currently for this I'm
using this controller:

def create():
    form = crud.create(db.booking, next = URL('index'))
    return dict(form=form)

So I was wondering to use a validator like this:

db.booking.room_id.requires = IS_IN_DB(db, db.room.id, '%
(name)s',multiple=True)

But It doesn't work.


And when a user saves a booking It must sent an email to an admin, the
admin should validate the booking.

So the magic question is, How could I do all above?

Thank's!!!

Reply via email to