On Tuesday, May 13, 2014 5:06:52 AM UTC+5:30, Michael Beller wrote:
>
> I haven't used 'list:reference' before, what are the advantages or use
> cases for your approach rather than add a reference field such as
> Field('daily', 'reference daily') on the post table?
>
Generic use case (I could think of)
db.define_table('parent',
Field('fname', 'string'),
Field('lname', 'string'),
format='%(fname)s %(lname)s'
)
db.define_table('child',
Field('fname', 'string'),
Field('lname', 'string'),
Field('parents', 'list:reference parent'),
format='%(fname)s %(lname)s'
)
So basically - child has two parents.
using "reference parent" can be used to point to only one of the parents.
list:reference allows you to point to multiple parents
-Mandar
--
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.