> > > myurl.com/activities/[u'ireland<http://myurl.com/activities/%5Bu%27ireland>', > > > u'nireland']/: what I really want > > > is: > > > > /activities/ireland-nireland/ >
I'm not sure if any of this is the 'correct' way but it likely will work. Try a combination of python's eval() and str() function to convert/maninuplate the location_filter object into a string and format into the string you want. As well it seems you should be able to pull the elements out of the location_filter using something like location_filter[1] and location_filter[2] and then format the string to your requirements. Also note there is a django function smart_str() that might help with working with the unicode formating. I've not tested this exactly but something like this, in theory from django.utils.encoding import smart_str location_filterAscii = smart_str(location_filter,encoding='utf-8') Or you can simply do something like mystring.replace("u,","") and other python string manipulators to get the string like you want it. Otherwise it seems this is python string manipulation stuff you can workout on the command line, using str() and/or eval(), and .replace. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---