Monday, May 26, 2014

Re: Django queryset csv encode

If you want all the user_name's in Staff as UTF-8:

staff = Staff.objects.all()
staff_list = [s.user_name.encode('utf-8') for s in staff]

I'm not familiar with the encoding you mentioned in your last message. Try it.

K


On Monday, May 26, 2014 2:12:14 AM UTC-7, hito koto wrote:
Hi,

this is output the one name, but i want to output all name, so i can't logic 
>>> name[0].encode("Shift_JIS")


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fe86810b-f9bf-45ae-bd04-7bedede31a12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment