I would like to use the paginate decorator and update the database at
the same time, but I'm having trouble making this work correctly. I'm
using SQLAlchemy. Here's an example.
@paginate('entries', allow_limit_override='True', limit=25)
def index(self):
entries = model.Entry.select(model.Entry.c.unread==1)
for entry in entries:
entry.viewed = 1
return dict(entries=entries)
The problem with this is it sets viewed to 1 for all entries, not just
the page that is returned by paginate. It seems like this is probably
the correct behavior for paginate, but how can I use paginate and
still update the database?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---