Closed ekohl closed 11 years ago
Maybe if user passes django.models.Model
instance as viewname, than we will call get_absolute_url()
on that and use it as url?
I think it's better to check if it has the attribute because not every model has it
Please try with current master, hopefully it does what You want.
I think it does, but it makes it impossible to pass a model but with a different viewname. Not sure if there's a real use case for that, but you could consider adding another check for that. Since this works with my use case I'll close this now.
In addition to #3 which made it possible to just display objects, wouldn't it be easy if you could just use get_absolute_url to build URLs? Maybe add some logic that if no viewname is given and the label has the attribute get_absolute_url that is used?