how can i add a reference in code? I have a scheduled task and i want to
update a field to reference 10 most current posts
db.define_table('daily',
Field('example'),
Field('datetime'),
Field('current', 'boolean')
Field('posts','list:reference post'),
)
db.define_table('post',
Field('body'),
)
i would assume i could just query the db and get the 10 most recent
(orderby and limitby) and then run a for loop to store the ids into a
listvar[] and then find the record in daily with current set to True and
assign it to record_to_be_updated then just do record_to_be_updated.posts =
listvar[] then do a .updaterecord() on it but its not working and ive
tried everything im sure im just missing something easy and i would post
some code but ive tried so much and destroyed it out of frustration :(
--
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.