I recommend writing a custom template tag. (http://
www.djangoproject.com/documentation/templates_python/#writing-custom-template-tags).
So you would have for example:
{ list_member_events object }
Then in your template tag code you would be able to handle the logic
that is a little too
Thanks for the idea, but that doesn't quite work either. If someone
only has 3 events, then the for loop runs through 3 times, and I end
up with only three TD's. I'm pretty sure what I need can't be
accomplished in template code.
I think I need to assign all the variables in view code, then
You just need something like:
{% for p in object.events.all %}
{% if p.event_name %}
{{ p.event_name }},
{% else %}>
{% endif %}
{% endfor %}
You could put the whole row in the IF, if you like.
On Jun 12, 8:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I
I think that requires more logic in the template than possible.
My brain says tot do exactly what you suggest. But my template looks
similar to this:
{% for p in object.events.all %}
{{ p.event_name }},
{%
[snip
>
> The trouble I'm having is, if someone is not assigned to an event, I
> get nothing displayed (duh, there's not an event); except I'm
> displaying this in a table, and if I don't have any data, then the
> cell formatting doesn't line up correctly.
[snip]
I just quickly perused your
I'm having trouble pulling/formatting data into my template.
I have added some Event items into the database. For the example,
we'll say "golfing", "hiking" and "swimming".
In my template, using the generic object_list, I want to list each
member's information (easy enough) and then each
6 matches
Mail list logo