choices field language

96 views
Skip to first unread message

Xristos Xristoou

unread,
Jun 20, 2016, 5:44:38 PM6/20/16
to Django users
hello i want to use choices in my field but not work if i write in my language(greek) only work in the england language.
if i writing choices in my language show me error message in the admin mode (this choose is not valid),any idea how to fix that ?i have python 2.7

ludovic coues

unread,
Jun 21, 2016, 1:40:57 PM6/21/16
to django...@googlegroups.com
Python 3 have a better support of international alphabet.
> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5bfdb5b9-e286-40e1-aa8b-2a0e68878204%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42

Luis Zárate

unread,
Jun 21, 2016, 4:48:18 PM6/21/16
to django...@googlegroups.com
Use in the first line

#- coding: utf-8
from __future__ import unicode_literals

And put in models



from django.utils.encoding import python_2_unicode_compatible

@python_2_unicode_compatible
class MyClass(object):
   def __str__(self):
       return "Instance of my class"

See more in

https://docs.djangoproject.com/en/1.9/topics/python3/
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEuG%2BTaq-wqgpk1k2B%2BiGWesPdo32OvRhFGAEHu%2BwC7p25%2BmHQ%40mail.gmail.com.

> For more options, visit https://groups.google.com/d/optout.
>

--
"La utopía sirve para caminar" Fernando Birri



Reply all
Reply to author
Forward
0 new messages