Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
6213a650
Commit
6213a650
authored
4 years ago
by
Bastien Abadie
Browse files
Options
Downloads
Plain Diff
Merge branch 'fast-worker-admin' into 'master'
Faster worker admin Closes
#689
See merge request
!1284
parents
fdf77b05
d49b2000
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1284
Faster worker admin
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex/dataimport/admin.py
+11
-0
11 additions, 0 deletions
arkindex/dataimport/admin.py
with
11 additions
and
0 deletions
arkindex/dataimport/admin.py
+
11
−
0
View file @
6213a650
...
...
@@ -71,7 +71,18 @@ class RepositoryAdmin(admin.ModelAdmin):
class
WorkerVersionInline
(
admin
.
StackedInline
):
show_change_link
=
True
model
=
WorkerVersion
fields
=
(
'
revision
'
,
'
state
'
,
'
configuration
'
,
'
docker_image_id
'
)
readonly_fields
=
(
'
revision
'
,
'
state
'
,
'
configuration
'
,
'
docker_image_id
'
)
def
get_queryset
(
self
,
*
args
,
**
kwargs
):
"""
Prefetch worker and revision as they are used in versions inline labels.
Using a proxy model to override `__str__` is possible but removes the Change link
as the model does not appear as registered.
"""
return
super
().
get_queryset
(
*
args
,
**
kwargs
).
prefetch_related
(
'
worker
'
,
'
revision
'
)
class
WorkerAdmin
(
admin
.
ModelAdmin
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment