Hello,
I have two table, one references another:
db.define_table('table_a',
Field('field_a_1'),
format='%(field_a_1)s')
db.define_table('table_b',
Field('field_b_1'),'reference table_a',
Field('field_b_2'))
When using SQLFORM.grid edit, I don't want to have the drop down menu for
the field_b_1 with all available options of field_a_1, but I want to see an
autocomplete widget.
If a value entered is not one of allowed choices, I want to add this choice
into the 'table_a'. So in other words, I want to dynamically grow the
table_a when I enter something in table_b.
I tried to use autocomplete_widget with Field_b_1 (and treat try except for
the validator), but it doesn't work, the default drop down is shown.
One way would be to remove the reference, but I want to keep it because of
the reference clearly shows foreign keys in Models.py (and also cascade
deletes).
Is there any way around?
Thanks in advance!
Peter.
--
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.