{{{
class aModel(Model):
name = models.CharField(_('name'), null=True, max_length=64,
blank=True, default=None)
class bModel(Model):
aLink = models.ForeignKey(aModel, null=False, blank=False)
def __unicode__(self):
return u'%s' % (self.aLink.name)
}}}
gives error at admin:
RelatedObjectDoesNotExist at ....
bModel has no aLink.
same for
{{{
def __unicode__(self):
return u'%s' % str(self.id)
}}}
but works with
{{{
def __unicode__(self):
return u'%s' % (self.id.aLink.name)
}}}
is it correct?
--
Ticket URL: <https://code.djangoproject.com/ticket/24869>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Which page gives the error and what is the full traceback?
--
Ticket URL: <https://code.djangoproject.com/ticket/24869#comment:1>
* status: new => closed
* resolution: => needsinfo
--
Ticket URL: <https://code.djangoproject.com/ticket/24869#comment:2>