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
1e02e391
Commit
1e02e391
authored
13 years ago
by
Leonidas Poulopoulos
Browse files
Options
Downloads
Patches
Plain Diff
Added peer plus techc into admin interface
parent
86da41f0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
flowspec/admin.py
+19
-1
19 additions, 1 deletion
flowspec/admin.py
peers/models.py
+3
-0
3 additions, 0 deletions
peers/models.py
with
22 additions
and
1 deletion
flowspec/admin.py
+
19
−
1
View file @
1e02e391
...
...
@@ -5,10 +5,26 @@ from utils import proxy as PR
from
flowspec.tasks
import
*
from
django.contrib.auth.models
import
User
from
django.contrib.auth.admin
import
UserAdmin
from
accounts.models
import
UserProfile
from
flowspy.accounts.models
import
UserProfile
from
flowspy.peers.models
import
*
from
flowspy.flowspec.forms
import
*
import
datetime
from
django.conf
import
settings
from
django.forms
import
ModelForm
from
django.contrib.admin.widgets
import
FilteredSelectMultiple
class
PeerAdminForm
(
ModelForm
):
networks
=
forms
.
ModelMultipleChoiceField
(
PeerRange
.
objects
.
all
(),
widget
=
FilteredSelectMultiple
(
"
PeerRange
"
,
True
),
required
=
False
)
class
Meta
:
model
=
Peer
class
PeerAdmin
(
admin
.
ModelAdmin
):
form
=
PeerAdminForm
class
PeerTechcAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'
get_peer_name
'
,
'
emails
'
)
class
RouteAdmin
(
admin
.
ModelAdmin
):
form
=
RouteForm
...
...
@@ -71,6 +87,8 @@ admin.site.register(UserProfile)
admin
.
site
.
register
(
ThenAction
)
#admin.site.register(ThenStatement)
#admin.site.register(MatchStatement)
admin
.
site
.
register
(
Peer
,
PeerAdmin
)
admin
.
site
.
register
(
PeerTechc
,
PeerTechcAdmin
)
admin
.
site
.
register
(
Route
,
RouteAdmin
)
admin
.
site
.
register
(
User
,
UserProfileAdmin
)
admin
.
site
.
disable_action
(
'
delete_selected
'
)
...
...
This diff is collapsed.
Click to expand it.
peers/models.py
+
3
−
0
View file @
1e02e391
...
...
@@ -50,5 +50,8 @@ class PeerTechc(models.Model):
def
__unicode__
(
self
):
return
"
%s %s
"
%
(
self
.
peer_id
.
peer_name
,
self
.
emails
)
def
get_peer_name
(
self
):
return
"
%s
"
%
self
.
peer_id
.
peer_name
class
Meta
:
db_table
=
"
v_tech_c_peers
"
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