On Wed, Dec 20, 2006 at 08:27:11AM -0500, Austin Govella wrote:
I have a list from a queryset: * foo * bar * twinky Is there an easy way to output that as: "foo, bar, and twinky"
If you want to do it in python, use reduce: ---------------------------------------------------------------------- # l is the list, r is the humanised result r = reduce(lambda x, y: str(x) + "," + str(y), l) ---------------------------------------------------------------------- or similar. James -- /--------------------------------------------------------------------------\ James Aylett xapian.org [EMAIL PROTECTED] uncertaintydivision.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---