uhm. just one sec.... let's get back to the beginning ......reference fields support is for storing the primary key of the referenced table.... if you define things as you did, you'll get db.reel.sid with an id pointing out to the 'stuff' record whose id is that one. this seems to clash with the "what I want" statement you exposed..... please clarify what you want stored in tables before continuing....
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/OYly9gV1GHA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
db.define_table('stuff',
Field('nombre', 'string', requires=IS_NOT_EMPTY()),
format='%(nombre)s'
)
db.define_table('reel',
Field('whatever', 'string', requires=IS_NOT_EMPTY()),
Field('sid', 'reference stuff')
)
def reel():
db.reel.sid.widget = SQLFORM.widgets.autocomplete(request, db.stuff.nombre, id_field=db.stuff.id)
grid = SQLFORM.grid(db.reel, user_signature=False)
return locals()
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/OYly9gV1GHA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Notice that the important difference is in the order. Niplhod set the widget for the field before calling SQLFORM.grid.
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/OYly9gV1GHA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
format='%(nombre)s')