On Sep 9, 7:32 am, Mike Dewhirst <mi...@dewhirst.com.au> wrote:
> I would like to get breadcrumbs working in a simple way. Could anyone
> please help?
>
> I think I need a singleton with a dict like this ...
>
> bread = singleton()
>
> bread.dct['last_title'] =
>
> Within each view and before doing anything else I want to ...
>
> def someview(request):
>     title = 'whatever'
>     crumb = bread.dct['last_title']
>     bread.dct['last_title'] = title
>     # put title and crumb into the view context for extraction
>     # in the template as {{title}} and {{crumb}}
>
> Is there a better way?
>
> Thanks
>
> Mike

Why do you need a singleton here? This is a pattern you don't see
often in Python, so I'm intrigued as to why you think you need it.

Anyway, the better way is to do this as a templatetag.
--
DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to