Question

I have some problems with Django Grappelli Autocomplete.

It works just fine but for some reason, if the name has french accents (é,è,etc) the field shows an '?'.

Here is the screenshot:

http://gyazo.com/64dfb579ccf9e11c0f0d9ee8337edec4

Here is my related label:

    def related_label(self):
    return str(self.getFullName)+" - "+ str(self.city)

Thanks

Était-ce utile?

La solution

Return unicode object instead of str.

def related_label(self):
    return u'{0.getFullName} - {0.city}'.format(self)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top