Before:
{{{
class Foo(models.Model):
...
class Meta:
verbose_name = _('foo')
class Bar(models.Model):
foo = models.ForeignKey(Foo, verbose_name=_('foo'))
}}}
After:
{{{
class Foo(models.Model):
...
class Meta:
verbose_name = _('foo')
class Bar(models.Model):
foo = models.ForeignKey(Foo)
}}}
This patch only works when you specify a class and not a lazy reference to
the object.
It also reduces the memory consumption.
--
Ticket URL: <https://code.djangoproject.com/ticket/25039>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "25039.diff" added.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
The patch uses deprecated APIs so the test suit can't run, but even when
updated as below, there are still problems running the tests.
{{{
if self.verbose_name is None and self.remote_field and not
isinstance(self.remote_field.model, six.string_types):
self.verbose_name = self.remote_field.model._meta.verbose_name
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25039#comment:1>
Comment (by djbaldey):
Replying to [comment:1 timgraham]:
> The patch uses deprecated APIs so the test suit can't run, but even when
updated as below, there are still problems running the tests.
> {{{
> if self.verbose_name is None and self.remote_field and not
isinstance(self.remote_field.model, six.string_types):
> self.verbose_name = self.remote_field.model._meta.verbose_name
> }}}
Sorry, that was meant for 1.8, I'll try to rewrite under master
--
Ticket URL: <https://code.djangoproject.com/ticket/25039#comment:2>
* status: new => closed
* resolution: => invalid
Comment:
Bad idea. It's works, but in order to do have to change a bunch of tests.
--
Ticket URL: <https://code.djangoproject.com/ticket/25039#comment:3>