On 12/6/06 1:48 PM, [EMAIL PROTECTED] wrote:
> I have a model, which has ForeignKey relationship to another model set
> up. How can I output a list of all the objects within the ForeignKey as
> a comma separated list?
> 
> For example - the list has 3 objects (a, b, c) - so should output a
> list like "a, b, c"
> 
> How can I do this (in the template)?

{{ myobject.relation_set|join:", " }}

See http://www.djangoproject.com/documentation/templates/#join

Jacob

--~--~---------~--~----~------------~-------~--~----~
 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