On Mon, 2006-10-02 at 16:05 -0700, frank wrote:
> I have a simple loop which sets up a series of radio-buttons.
> "objgroup" is
> obtained through a DB query/filter:
> 
> {% for obj in objgroup %}
>     <P><INPUT TYPE=RADIO NAME="selected" VALUE={{ obj.id }}
>                {% ifequal seek_id  obj.id %} CHECKED {% endifequal %} >
>      showing other things... </P>
> {% endfor %}
> 
> However the operation never indicates the desired default condition.
> If I force an exception, I can see that the "seek_id" that I pass into
> the
> template has been forced into a list (as happens to everything).
> Attributes
> of objects, of course, don't get list-ified, so I speculate that this
> is why
> the comparison never succeeds even when the interior values would
> appear to match.  i.e.: [n] != n   The obvious seek_id[0] fails, as
> does
> referring to it as {{seek_id}} within the {% ifequal...%}.


This will probably be easier to diagnose if you can explain how seek_id
is generated. We don't coerce everything into lists, so something is
going on to make it a list at that point. So what does your view do to
generate seek_id?

Regards,
Malcolm



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

Reply via email to