On Wed, Sep 16, 2009 at 3:02 PM, Daniel Roseman <dan...@roseman.org.uk> wrote: >> >> def __repr__(self): >> return ugettext_lazy("%(file)s (Component: %(component)s - >> Release: %(release)s)") % { >> 'file': self.filename, >> 'component': self.component.name, >> 'release': self.release.name,} >> >> (I tried also with ugettext) > > Try putting a u just before the open quote: > > return ugettext_lazy(u"%(file)s (Component: %(component)s - > Release: %(release)s)")
Same error. If a do: print "%(file)s (Component: %(component)s - Release: %(release)s)" .... it works but: print repr(object) don't > > I don't know much about ugettext_lazy, but often unicode errors are > caused by using bytestrings where you should be using unicode strings. -- Kind Regards --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---