Daniel Roseman wrote:
> On Sep 9, 7:32 am, Mike Dewhirst <[email protected]> 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.

I'm obviously off track. I just looked at template tags again and can't 
see anything - other than making a custom tag which seems a bit much for 
me just at the moment.

Apart from hard-coding variables in a template and passing the values in 
a context dictionary, how should it be done? Can you point me to any 
examples?

Thanks

Mike




> --
> DR.
> > 
> 
> 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to