> The problem is that, for example, I would need to set a breadcrumb. > This breadcrumb would *depend on* which view is supposed to be > executed. > > For example, when you are viewing a product, it might say "Your are > here: Store>> Special product>> product_name", but when you are > looking at several products of the same category, it would display > "You are here: Store>> Brushes>> Red" > > Now, in the moment the context processor gets executed, do I have that > in the request object? I was implementing you suggestion but the GET > and POST dicts are both empty. > > Isn't a way to like... inject an extra context to any satchmo view? >
Yes, exactly. That's what a context processor is for - it makes extra "context" available to any Django view, not just Satchmo specifically. Whatever code you are actually executing in your views should be able to be moved to a context processor, or some other helper (like a templatetag). That's how you will prevent having all the duplicate code you were mentioning at first. I don't know the specifics of your implementation, but having breadcrumbs should be something you can implement without knowing what view you are executing, right? Breadcrumbs usually are determined by URL, aren't they? And a URL is a different piece of information that can be processed from the request object than what view is executed at that URL. Perhaps a wrapper function for template rendering would be the way to go. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Satchmo 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/satchmo-users?hl=en -~----------~----~----~----~------~----~------~--~---
