On Sunday 15 November 2009 08:27:29 Nagy Károly wrote:

> In the template i cannot decide if specific attribute is assigned to a
> car or not, because i cant pass parameter to method call.
> 
> How can i override this?
> 

I have a love affair with these things, but template tags [1] would help.  But 
template tags should be used for template objects that require filtering or 
displaying context objects not specifically associated with the view.  If you 
want the car object to go through this choice in many different views, you'll 
want a template tag, but if it's only in one view method, you should do it in 
the method.  For good examples on how/when to use custom template tags look at 
the comments framework or csrf one.  The comment framework example is good 
because that application can be attached to any model and added to any view, 
so in this case you want it as a template tag.

Hope this helps

Mike

[1] http://docs.djangoproject.com/en/dev/howto/custom-template-tags/



-- 
The camel died quite suddenly on the second day, and Selena fretted
sullenly and, buffing her already impeccable nails -- not for the first
time since the journey begain -- pondered snidely if this would dissolve
into a vignette of minor inconveniences like all the other holidays spent
with Basil.
                -- Winning sentence, 1983 Bulwer-Lytton bad fiction contest.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to