문제

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

도움이 되었습니까?

해결책

Return unicode object instead of str.

def related_label(self):
    return u'{0.getFullName} - {0.city}'.format(self)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top