yup, I made this in the utils.py of most my components

def viewURLFor(item):
    cdtate = getMultiAdapter((item, item.REQUEST), name='plone_context_state)
    return cstate.view_url()

Cheers
-- 
Gilles Lenfant

Le 16 févr. 2011 à 19:57, toutpt a écrit :

> 
> As far as I know ... there is no other solution.
> 
> I often just import component and use component.getMultiAdapter, more easy
> to read and made less imports.
> Only two lines of code to get the url is quite good and it works for every
> things.
> 
> Enjoy zope component ;) 
> 
> -----
> Jean-Michel François aka toutpt
> http://toutpt.wordpress.com
> http://twitter.com/toutpt
> 
> -- 
> View this message in context: 
> http://plone.293351.n2.nabble.com/URL-to-content-view-tp6028204p6033062.html
> Sent from the Product Developers mailing list archive at Nabble.com.
> _______________________________________________
> Product-Developers mailing list
> Product-Developers@lists.plone.org
> https://lists.plone.org/mailman/listinfo/product-developers

_______________________________________________
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers

Reply via email to