Re: Conditionals in Templates
On 4-7-2012 0:49, Javier Guerra Giraldez wrote:
> On Tue, Jul 3, 2012 at 3:39 PM, Bill Freeman <ke1g.nh@gmail.com> wrote:
>> The obvious ways are:
>>
>> 1. Provide a model method that returns a string representing the type
>> of the instance, compare against that
>> 2. Decorate the instance with an attribute giving the name of the type
>> as a string...
>
> 3. write a template tag
4. Don't use polymorphic variables in templates. Handle it in the view
by providing differently named variables (x and x_list for example).
--
Melvyn Sopacua
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home