2007/4/4, Malcolm Tredinnick <[EMAIL PROTECTED]>: > > Hi Marcelo, > > On Wed, 2007-04-04 at 17:46 -0300, Marcelo Ramos wrote: > > After submitting a form using a generic view I get this error: > > > > Request Method: POST > > [...] > > Exception Type: ValueError > > Exception Value: incomplete format > > Exception Location: > > /usr/lib/python2.3/site-packages/django/views/generic/create_update.py > > in create_object, line 43 > > > > It seems an error with the format given to gettext(): > > > > request.user.message_set.create(message=gettext("The %(verbose_name)s > > was created successfully.") % {"verbose_name": > > model._meta.verbose_name}) > > > > Is that a bug or a feature? I checked that model._meta.verbose_name > > has the correct value then i'm a bit lost here. > > Me, too. That looks unexpected. I've been trying to iron out a few i18n > problems during the last few days, so it's possible that either (a) I've > introduced a new bug or (b) fixing an older problem has exposed this.
Well, it seems to be just a syntax error: request.user.message_set.create(message=gettext("The %(verbose_name)s was created successfully." % {"verbose_name": model._meta.verbose_name})) Remove the ) after successfully." and add it in the end of the line. Isn't the correct syntax gettext(".. %(foo) .." % {'foo': 'bar'} )) instead of gettext(".. %(foo) ..") % {'foo': 'bar'} ) ? But another problem remains: the string is not being translated here. If you need any help or feedback i'm here to help. Regards. -- Marcelo Ramos Fedora Core 6 | 2.6.19 Socio UYLUG Nro 125 --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---