Hi all

Given the following model (polymodel location -> location_outdoor & 
location_indoor) on GAE:

define_table('location',
    Field('name', 'string'),
    Field('active', 'boolean'),
    polymodel = True)

define_table('location_outdoor',
    db.location,
    Field('country', 'string'),
    Field('city', 'string'),
    Field('postcode', 'string'),
    Field('street', 'string'),
    Field('building', 'string'),
    polymodel = db.location)

define_table('location_indoor',
    db.location
    Field('location_outdoor', db.location_outdoor),
    Field('floor', 'string'),
    Field('room', 'string'),
    polymodel = db.location)

- Is there a way to create a generic controller (using SQLFORM.grid) which 
is able to create outdoor or indoor locations (display either 
location_outdoor or location_indoor fields)?
I'm thinking of a select field where I can select the class. Depending on 
the class it will show the available fields.
I should be able to modify the SQLFORM.grid to get view and edit operations 
to use the correct class. But what about the create operation?

- How can I add an extra field to the SQLFORM.grid view form which displays 
the location? I would like to add a field which does contain a generated 
QR-code.

- Why are the indexes in index.yaml always called "location" and not 
"location_outdoor" and "location_indoor"? I'm often receiving the error 
message that location_indoor does not contain 'city', which is true.

Cheers
-Luca.

-- 



Reply via email to