[OT question: Why does top-posting seem to be the default response mode on this
list?]
As a follow-up to this question, how would one cast the output as a table where
the major field is only displayed on change. I.e., how to produce tabular
output of the form
Widgets Widget 1
Widget 2
Widget 3
Wodgets Wodget 1
Wodget 2
Wodget 3
regards
Steve
Dana wrote:
> You could try the template filter "unordered_list" too I believe
> (haven't done it myself).
>
> http://docs.djangoproject.com/en/dev/ref/templates/builtins/#unordered-list
>
> Cheers
>
> On Sep 11, 11:36 am, "Lance F. Squire" <[EMAIL PROTECTED]> wrote:
>
>> Currently using Django version 0.96.3, on a Fedora 8 system.
>>
>> I've currently set-up models for 'Manufacturer' and 'System'. System
>> has a Foreignkey to Manufacturer.
>>
>> I'd like to display a list like so:
>>
>> Manu A
>> System a
>> System b
>> System c
>>
>> Manu B
>> System a
>> System b
>> System c
>>
>> Etc...
>>
>> Only listing Manufacturers that had systems of type X.
>>
>> I was thinking of using code like this in the View,
>>
>> man=Manufacturer.objects.all()>>> for m in man:
>>
>> ... sys=System.objects.filter(manufacturer=m.id)
>> ... print m.name
>> ... for s in sys:
>> ... print " %s" % s.name
>> ...
>>
>> This works from the shell, but I'm unsure how to get the output to the
>> template And, I suspect is a terribly inefficient way to do it anyway.
>>
>> I'm guessing I should be doing something simpler here and then doing
>> something in the template to form the list....
>>
>> Any help appreciated, including severe beatings with a clue stick. ;)
>>
>> This is only my 2nd attempt at a Django project, and I'm stumped at
>> the moment.
>>
>> Thanks,
>>
>> Lance
>>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---