django-modeladmin-reorder icon indicating copy to clipboard operation
django-modeladmin-reorder copied to clipboard

Support Non-ASCII character in labels

Open pyjavo opened this issue 7 years ago • 7 comments

I tried to customize a label in spanish bu couldn't. I got this error: SyntaxError: Non-ASCII character '\xc3' in file /Users/username/myproject/settings.py on line xxx, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details I am using OS X EL Capitan

pyjavo avatar Jun 20 '17 13:06 pyjavo

Will adding the following at the top of the file, fix this issue?

# -*- coding: utf-8 -*-

from __future__ import unicode_literals

mishbahr avatar Jun 20 '17 13:06 mishbahr

It worked!!!! Using only this # -*- coding: utf-8 -*-

But if i paste the 'from future' line, this is what i get:

   TypeError at /admin/
   ADMIN_REORDER list item must be dict or string. Got u'myapp'

pyjavo avatar Jun 20 '17 15:06 pyjavo

If you want to do a pull request with just the first line. I'll be happy to merge it.

mishbahr avatar Jun 20 '17 15:06 mishbahr

@javierdaza Sorry it took me this long to look into this. Can you try the latest master version and see if you still get this error. If not I'll push it to PyPi. – Mishbah

mishbahr avatar Apr 25 '18 16:04 mishbahr

@mishbahr don't worry. Didn't do a pull request because before because didn't know how to fix it properly. I will try and let you know, probably starting next week

pyjavo avatar Apr 25 '18 19:04 pyjavo

And even more - last commit has broken Python 3 compatibility because basestring is no longer available in Python 3.

dglinyanov avatar Apr 28 '18 09:04 dglinyanov

@dglinyanov sorry about that. Fixed.

mishbahr avatar May 01 '18 11:05 mishbahr