Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Base de données Mediatek
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mediatek
Base de données Mediatek
Commits
626990b1
Verified
Commit
626990b1
authored
Aug 15, 2019
by
erdnaxe
🦋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use media str method for admin
parent
04c00fd5
Pipeline
#1446
passed with stage
in 3 minutes and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
media/admin.py
media/admin.py
+1
-9
media/models.py
media/models.py
+4
-2
No files found.
media/admin.py
View file @
626990b1
...
...
@@ -18,7 +18,7 @@ class AuteurAdmin(VersionAdmin):
class
MediaAdmin
(
VersionAdmin
):
list_display
=
(
'
full_name
'
,
'authors_list'
,
'side_identifier'
,
'isbn'
,
list_display
=
(
'
__str__
'
,
'authors_list'
,
'side_identifier'
,
'isbn'
,
'external_link'
)
search_fields
=
(
'title'
,
'authors__nom'
,
'side_identifier'
,
'subtitle'
,
'isbn'
)
...
...
@@ -26,14 +26,6 @@ class MediaAdmin(VersionAdmin):
date_hierarchy
=
'publish_date'
form
=
MediaAdminForm
def
full_name
(
self
,
obj
):
if
obj
.
subtitle
:
return
"{} : {}"
.
format
(
obj
.
title
,
obj
.
subtitle
)
else
:
return
obj
.
title
full_name
.
short_description
=
_
(
'name'
)
def
authors_list
(
self
,
obj
):
return
", "
.
join
([
a
.
nom
for
a
in
obj
.
authors
.
all
()])
...
...
media/models.py
View file @
626990b1
...
...
@@ -63,8 +63,10 @@ class Media(models.Model):
)
def
__str__
(
self
):
return
str
(
self
.
title
)
+
' - '
+
str
(
self
.
subtitle
)
\
+
' - '
+
str
(
self
.
authors
.
all
().
first
())
if
self
.
subtitle
:
return
"{} : {}"
.
format
(
self
.
title
,
self
.
subtitle
)
else
:
return
self
.
title
class
Meta
:
verbose_name
=
_
(
"medium"
)
...
...
Write
Preview
Markdown
is supported
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