Ticket #5373: 5373.5.diff

File 5373.5.diff, 976 bytes (added by Lachlan Musicman, 14 years ago)

Proves that self.verbose_name is never none

  • django/db/models/fields/related.py

     
    1313from django.core import exceptions
    1414from django import forms
    1515
    16 
    1716RECURSIVE_RELATIONSHIP_CONSTANT = 'self'
    1817
    1918pending_lookups = {}
     
    111110
    112111    def set_attributes_from_rel(self):
    113112        self.name = self.name or (self.rel.to._meta.object_name.lower() + '_' + self.rel.to._meta.pk.name)
    114         if self.verbose_name is None:
     113        if (self.verbose_name != self.rel.to._meta.verbose_name):
     114          print "**I can get here**"
     115        if self.verbose_name is None:
    115116            self.verbose_name = self.rel.to._meta.verbose_name
     117            print "----------- but never here -----------"
    116118        self.rel.field_name = self.rel.field_name or self.rel.to._meta.pk.name
    117119
    118120    def do_related_class(self, other, cls):
Back to Top