Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FoD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schmitz
FoD
Commits
24e40f42
Commit
24e40f42
authored
10 years ago
by
Stauros Kroustouris
Browse files
Options
Downloads
Patches
Plain Diff
add search field in admin
parent
231de10c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
accounts/admin.py
+1
-0
1 addition, 0 deletions
accounts/admin.py
flowspec/admin.py
+2
-0
2 additions, 0 deletions
flowspec/admin.py
peers/admin.py
+12
-2
12 additions, 2 deletions
peers/admin.py
with
15 additions
and
2 deletions
accounts/admin.py
+
1
−
0
View file @
24e40f42
...
...
@@ -28,6 +28,7 @@ from accounts.models import UserProfile
class
UserPrAdmin
(
admin
.
ModelAdmin
):
search_fields
=
[
'
user__username
'
,
'
peer__peer_name
'
]
list_display
=
(
'
user
'
,
'
peer
'
)
admin
.
site
.
register
(
UserProfile
,
UserPrAdmin
)
...
...
This diff is collapsed.
Click to expand it.
flowspec/admin.py
+
2
−
0
View file @
24e40f42
...
...
@@ -32,6 +32,7 @@ from longerusername.forms import UserCreationForm, UserChangeForm
class
RouteAdmin
(
admin
.
ModelAdmin
):
form
=
RouteForm
actions
=
[
'
deactivate
'
]
search_fields
=
[
'
destination
'
,
'
name
'
,
'
applier__username
'
]
def
deactivate
(
self
,
request
,
queryset
):
queryset
=
queryset
.
filter
(
status
=
'
ACTIVE
'
)
...
...
@@ -68,6 +69,7 @@ class UserProfileInline(admin.StackedInline):
class
UserProfileAdmin
(
UserAdmin
):
search_fields
=
[
'
username
'
]
add_form
=
UserCreationForm
form
=
UserChangeForm
actions
=
[
'
deactivate
'
,
'
activate
'
]
...
...
This diff is collapsed.
Click to expand it.
peers/admin.py
+
12
−
2
View file @
24e40f42
...
...
@@ -43,8 +43,18 @@ class PeerAdminForm(ModelForm):
class
PeerAdmin
(
admin
.
ModelAdmin
):
search_fields
=
[
'
peer_name
'
,
'
networks__network
'
]
form
=
PeerAdminForm
class
PeerRangeAdmin
(
admin
.
ModelAdmin
):
search_fields
=
[
'
network
'
]
class
TechcEmailAdmin
(
admin
.
ModelAdmin
):
search_fields
=
[
'
email
'
]
admin
.
site
.
register
(
Peer
,
PeerAdmin
)
admin
.
site
.
register
(
PeerRange
)
admin
.
site
.
register
(
TechcEmail
)
admin
.
site
.
register
(
PeerRange
,
PeerRangeAdmin
)
admin
.
site
.
register
(
TechcEmail
,
TechcEmailAdmin
)
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