Resolving content ID into the full URL

9 views
Skip to first unread message

Andreas Jung

unread,
Apr 18, 2013, 4:10:35 AM4/18/13
to ko...@googlegroups.com
Sorry for this basic question:

I have a content-type recipe and the IDs are obviously numbers 1...N

How do I get the public edit URL of this object when I know the objects ID?

Andreas

Andreas Kaiser

unread,
Apr 18, 2013, 4:13:05 AM4/18/13
to ko...@googlegroups.com
from kotti.resources import Content

content_object = Content.query.filter(Content.id == id).one()
edit_url = request.resource_url(content_object, 'edit')


HTH,

Andreas
Reply all
Reply to author
Forward
0 new messages