On Wed, Feb 11, 2009 at 4:24 PM, KrcK <krc...@gmail.com> wrote:

>
> Hi all,
>
> I'm new in this group and I have to say that my English is very poor
> so sorry.
>
> I've the follow problem, I want to put in one of my base templates
> (that it's include in main base template) a list of one model, for
> example a Category model that has a relationship with other model like
> Post (this has a ForeignKey with Category).
>
> I can do it by two ways. I can create a context processor where I can
> retrive all category's objects and put them in the context so I could
> access them through all templates, or I can make a new tag where I can
> do the same and use it in that template.
>
> I don't know which is better and why, and if you've other ideas to do
> it I'm very interested in know them.
>
> Thanks and sorry about my english.
>
> >
>
I would do a template tag, for me the distinction is a context processor is
for getting just a single variable, such as MEDIA_ROOT or whatever, whereas
a templatetag is for getting some data and doing some processing.  I guess
it's a bit of a thin line for something like this but that's how I see it.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
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