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
dc9b0d59
Commit
dc9b0d59
authored
13 years ago
by
Leonidas Poulopoulos
Browse files
Options
Downloads
Patches
Plain Diff
Admin files cleanup and reordering
parent
84772eac
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flowspec/admin.py
+1
-27
1 addition, 27 deletions
flowspec/admin.py
peers/admin.py
+24
-0
24 additions, 0 deletions
peers/admin.py
peers/models.py
+1
-0
1 addition, 0 deletions
peers/models.py
with
26 additions
and
27 deletions
flowspec/admin.py
+
1
−
27
View file @
dc9b0d59
...
...
@@ -10,21 +10,6 @@ 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
...
...
@@ -66,7 +51,7 @@ class UserProfileInline(admin.StackedInline):
class
UserProfileAdmin
(
UserAdmin
):
actions
=
[
'
deactivate
'
,
'
activate
'
]
list_display
=
(
'
username
'
,
'
email
'
,
'
first_name
'
,
'
last_name
'
,
'
is_staff
'
,
'
is_active
'
,
'
get_userprofile_peer
'
)
list_display
=
(
'
username
'
,
'
email
'
,
'
first_name
'
,
'
last_name
'
,
'
is_staff
'
,
'
is_active
'
,
'
is_superuser
'
,
'
get_userprofile_peer
'
)
inlines
=
[
UserProfileInline
]
def
deactivate
(
self
,
request
,
queryset
):
...
...
@@ -88,22 +73,11 @@ class UserProfileAdmin(UserAdmin):
# kwargs['widget'] = PasswordInput
# return db_field.formfield(**kwargs)
#admin.site.register(MatchAddress)
admin
.
site
.
unregister
(
User
)
admin
.
site
.
register
(
MatchPort
)
admin
.
site
.
register
(
MatchDscp
)
admin
.
site
.
register
(
UserProfile
)
#admin.site.register(MatchFragmentType)
#admin.site.register(MatchIcmpCode)
#admin.site.register(MatchIcmpType)
#admin.site.register(MatchPacketLength)
#admin.site.register(MatchProtocol)
#admin.site.register(MatchTcpFlag)
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/admin.py
0 → 100644
+
24
−
0
View file @
dc9b0d59
from
django.contrib
import
admin
from
flowspy.peers.models
import
*
from
flowspy.flowspec.forms
import
*
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
'
)
admin
.
site
.
register
(
Peer
,
PeerAdmin
)
admin
.
site
.
register
(
PeerTechc
,
PeerTechcAdmin
)
admin
.
site
.
register
(
PeerRange
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
peers/models.py
+
1
−
0
View file @
dc9b0d59
...
...
@@ -9,6 +9,7 @@ class PeerRange(models.Model):
return
self
.
network
class
Meta
:
db_table
=
u
'
peer_range
'
ordering
=
[
'
network
'
]
# Create your models here.
class
Peer
(
models
.
Model
):
...
...
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