Commit 794941fd authored by Mindiell's avatar Mindiell

Adding full_name field

parent 4a41dbb6
...@@ -13,12 +13,13 @@ class Contact(models.Model): ...@@ -13,12 +13,13 @@ class Contact(models.Model):
photo = models.ImageField(upload_to='contacts/photos', blank=True) photo = models.ImageField(upload_to='contacts/photos', blank=True)
def __unicode__(self): def __unicode__(self):
return _('%(firstname)s %(lastname)s') % {'firstname': self.first_name, return _(u'%(firstname)s %(lastname)s') % {'firstname': self.first_name,
'lastname': self.last_name} 'lastname': self.last_name}
def full_name(self): def full_name(self):
return _('%(firstname)s %(lastname)s') % {'firstname': self.first_name, return _(u'%(firstname)s %(lastname)s') % {'firstname': self.first_name,
'lastname': self.last_name} 'lastname': self.last_name}
full_name.admin_order_field = 'first_name'
def get_photo_url(self): def get_photo_url(self):
if self.photo: if self.photo:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment