prymitive / bootstrap-breadcrumbs

Django template tags for easy breadcrumbs using twitter bootstrap css classes or custom template
django-bootstrap-breadcrumbs.readthedocs.org
MIT License
93 stars 48 forks source link

Make it possible to use get_absolute_url #5

Closed ekohl closed 11 years ago

ekohl commented 11 years ago

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?

prymitive commented 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?

ekohl commented 11 years ago

I think it's better to check if it has the attribute because not every model has it

prymitive commented 11 years ago

Please try with current master, hopefully it does what You want.

ekohl commented 11 years ago

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.