Access to related Objects inside a model propery
- by aliem
Hi, I just run into some problems with django models.
Example code is better than any word:
class Cart(models.Model):
updated_at = models.DateTimeField(auto_now=True)
created_at = models.DateTimeField(auto_now_add=True)
def __unicode__(self):
return u'date %s;'%(self.created_at)
def __str__(self):
return…