I'm using this URL as a value in a select box. The select box lists
all related models which can be added to the current object.
I want to be able to get the absolute 'add' page URL for each model.
On Mar 31, 10:17 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2008-03-31 at 01:01
On Mon, 2008-03-31 at 01:01 -0700, jurian wrote:
> Is there any way apart from the following to get the absolute URL of
> an object?
There is no canonical "absolute URL" for an object. It's one of the
things you define (in the get_absolute_url() method of the model). So
the absolute URL can be
Is there any way apart from the following to get the absolute URL of
an object?
opts = model._meta
url = "../../../%s/%s/add/" % (opts.app_label.lower(),
opts.object_name.lower())
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
3 matches
Mail list logo