Jeremy Dunck wrote:
> On 5/23/07, Michael Lake <[EMAIL PROTECTED]> wrote:
>>I notice it's a Set object comprising a single list. So I thought I could do 
>>this:
>>
>>{% for item in perms.lab %}
>>        {{ item }}
>>{% endfor %}
> 
> 
> Yeah, you can't do attribute access like that for a set.  It's not the
> same as a dictionary.
> I guess you're looking for any permissions that are for the 'lab' app?

Oh I'll probably just be doing stuff like:

{% if perms.lab.add_experiment %}
        < a href="something">Click to add experiment.</a>
{% endif %}
{% if perms.lab.delete_experiment %}
        < a href="something">Click to delete experiment.</a>
{% endif %}
{% if perms.lab.change_experiment %}
        < a href="something">Click to edit experiment.</a>
{% endif %}

Also I should ask:
        return render_to_response('lab/user.html', data)

was replaced with:
        ctx = RequestContext(request,data)
        return render_to_response('lab/user.html', context_instance=ctx)

But why? What's happening in the later case so why did this fix my problem.
I suppose I'm asking for an explanation of the magic under the carpet when I'm 
not 
even a magicians apprentice and will have problems understanding the answer :-)

Mike
-- 
Michael Lake




--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to