Or write a custom filter that checks to see if the current category is
found in the list of checked categories.

2009/11/17 Joshua Smith <[email protected]>:
> I usually tackle these kinds of problems with Javascript.  In the page you 
> generate, write javascript commands to check the boxes you need.
>
> function setChecks()
> {
>  {% for c in model.categories %}
>  document.getElementById("{{ c }}").checked = true;
>  {% endfor %}
> }
>
> ...
> {% for c in categories %}
>  <input type="checkbox" id="{{ c.key }}">
> {% endfor %}
>
> On Nov 17, 2009, at 12:23 PM, reza wrote:
>
>> I have a model M defined:
>>
>> class M:
>>  ...
>>  categories = db.ListProperty(db.Key)
>>
>> I'm trying to figure out a way to ensure that when a user chooses to
>> edit an instance of M they are presented with an edit page that:
>> 1) has a list of checkboxes for each category
>> 2) each category that belongs to the instance of M being edited is
>> preselected (prechecked)
>>
>> Since django templates aren't very powerful, I can't do the comparison
>> of the set of all categories vs the set of categories belonging to M
>> within the template (and I guess I shouldn't).  Can someone point me
>> to the correct pattern for doing this?
>>
>> Thanks,
>> Reza
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups 
>> "Google App Engine" 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/google-appengine?hl=.
>>
>>
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine" 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/google-appengine?hl=.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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/google-appengine?hl=.


Reply via email to