Hi,

I have models with verbose names translated into Hungarian. The
verbose names contain non-ascii characters. I have trouble adding,
editing, or deleting related objects through an admin inline. The
error I get is below. I can add, edit, delete them perfectly fine
directly through their own admin.

Has anyone seen this before? Is this a bug of admininline or am I
doing the something wrong?

Thanks,

Miklos

models.py
---------------
class Topic(models.Model):

    class Meta:
        verbose_name = _('topic')

admin.py
-------------
class TopicInline(admin.StackedInline):
    model = models.Topic

class ConferenceAdmin(admin.ModelAdmin):
    form = forms.ConferenceAdminForm
    inlines = [
        TopicInline,
               ]

---
And when I try to edit a Topic inlined in a Conference:
---
UnicodeDecodeError at /admin/conference/conference/1/
'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in
range(128)

Unicode error hint

The string that could not be encoded/decoded was: t��mak� <Hungarian
verbose name of Topic>
---
The error seems to originate in:
---
django/contrib/admin/options.py in construct_change_message
                    change_message.append(_('Added %(name)s "%(object)
s".')
                                          % {'name':
added_object._meta.verbose_name,
                                             'object': force_unicode
(added_object)})
                for changed_object, changed_fields in
formset.changed_objects:
                    change_message.append(_('Changed %(list)s for %
(name)s "%(object)s".')
                                          % {'list': get_text_list
(changed_fields, _('and')),
                                             'name':
changed_object._meta.verbose_name,
                                             'object': force_unicode
(changed_object)}) ...
                for deleted_object in formset.deleted_objects:
                    change_message.append(_('Deleted %(name)s "%
(object)s".')
                                          % {'name':
deleted_object._meta.verbose_name,
                                             'object': force_unicode
(deleted_object)})
        change_message = ' '.join(change_message)
        return change_message or _('No fields changed.')

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to