Hi, this is probably simple but searching as come up a blank and I'm still
very new to web2py
I have three tables, 'manufacturer' , 'model', and 'shoe'
Manufacturer contains 'Asics','Nike'
Then 'model' has parent of 'manufacturer', and will have 'Asics', 'Gel
Nimbus' and 'Nike','Vomero'
'shoe' is child of 'model', and contains other details about a paticular
instance of a manufacturer/model
What I want is for the drop down when 'shoe' is created (in admin, and in
forms), to show 'Asics Gel Nimbus', or 'Nike Vomero'
At the moment it just says 'Vomero', or 'Gel Nimbus', i.e. the immediate
parent.
Here are my models, I've tried using the other parent in the 'format', but
I can't get it to work, or even if that's the correct thing to attempt.
Thanks for any help
Models:
db.define_table(
'manufacturer',
Field('name'),
format = '%(name)s')
db.define_table(
'model',
Field('manufacturer', db.manufacturer),
Field('model'),
format = '%(model)s')
db.define_table(
'shoe',
Field('model',db.model),
Field('purchased','date'),
Field('price','integer'),
format = '%(manufacturer.name)s %(model)s')
So that's my attempt at putting the parent chain in to 'format'
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.