Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
piphone
campaign
Commits
794941fd
Commit
794941fd
authored
Jan 15, 2015
by
Mindiell
Browse files
Adding full_name field
parent
4a41dbb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
picampaign/contact/models.py
View file @
794941fd
...
...
@@ -13,12 +13,13 @@ class Contact(models.Model):
photo
=
models
.
ImageField
(
upload_to
=
'contacts/photos'
,
blank
=
True
)
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
}
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
}
full_name
.
admin_order_field
=
'first_name'
def
get_photo_url
(
self
):
if
self
.
photo
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment