Hi all
Posted this already - but apparently it did not show - so here we go
again.
I have the following problem (I am a rookie - so forgive me if this is
already explained elsewhere):
db.define_table('country', SQLField('name','string'))
db.define_table('city',
SQLField('country',db.country),
SQLField('name','string'))
db.city.country.requires = IS_IN_DB(db, 'country.id', 'country.name')
db.define_table('tourplan',
SQLField('date', 'date'),
SQLField('country',db.country),
SQLField('city',db.city)
)
db.tourplan.country.requires = IS_IN_DB(db, 'country.id',
'country.name')
#db.tourplan.city.requires = IS_IN_DB(db(db(?), 'city.id',
'city.name') #Not working as intended
What I would like to happen is the following:
Enter some contries in the country table.
Enter some cities in the city table and relate them to their country
Enter a tourplan, by selecting a date, a country (from the dropdown)
and a corresponding city (from the dropdown).
What I would like to happen is that the last city dropdown only shows
the cities that "belongs" to the previously selected country. I just
don't know how to make that happen.
Hope that someone can help. Thank you.
/Morten
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---