Sorry, not sure how that happened. My browser wasn't even opened when
those were sent.

Anyways, thanks for the suggestion. However, nested if statements (why
doesn't Django support elif?!) and multiple includes still seems very
awkward. I think I'll try using simple_tag to encapsulate my
permission logic, and call that for each row.

Regards,
Chris

On Feb 22, 10:28 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Sun, Feb 22, 2009 at 10:27 PM, Chris <chriss...@gmail.com> wrote:
>
> > I'm displaying a list of records in a template. I want to
> > conditionally display controls for each record if the current user is
> > admin, or the user owns the given record (indicated by record.user ==
> > request.user).
>
> > What's the best way to do this? Logically, all I want to do is {% if
> > request.user.is_superuser or request.user == record.user %} display
> > controls {% endif %} inside the loop. However, Django's default
> > template language doesn't seem to support this basic syntax. Is there
> > a non-hackish way to accomplish this with the default language?
>
> > Regards,
> > Chris
>
> You've now sent this message 3 times, you're want to either calm down or fix
> your mail client :).
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to