Re: Conditional Logic in Template Loop

2009-02-22 Thread Margie
My experience is that using the the various conditional templatetags is painful. I can never seem to do what I want, either because I'm too much of a newbie or there is some gotcha such as "filters don't work inside if" (I seem to remember something like that, but again, it might just be my own p

Re: Conditional Logic in Template Loop

2009-02-22 Thread Malcolm Tredinnick
On Sun, 2009-02-22 at 19:54 -0800, Chris wrote: > 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?!) Using "elif" wouldn't make things much simpler.

Re: Conditional Logic in Template Loop

2009-02-22 Thread Chris
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 permissi

Re: Conditional Logic in Template Loop

2009-02-22 Thread Alex Gaynor
On Sun, Feb 22, 2009 at 10:27 PM, Chris 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

Conditional Logic in Template Loop

2009-02-22 Thread Chris
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

Re: Conditional Logic in Template Loop

2009-02-22 Thread Alex Gaynor
On Sun, Feb 22, 2009 at 10:13 PM, Chris 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

Conditional Logic in Template Loop

2009-02-22 Thread Chris
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

Conditional Logic in Template Loop

2009-02-22 Thread Chris
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