Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
968fbb66
authored
Aug 16, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: add verbose_name to fields
parent
efd8ef6d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
24 deletions
+39
-24
firewall/models.py
+39
-24
No files found.
firewall/models.py
View file @
968fbb66
...
@@ -33,7 +33,7 @@ class Rule(models.Model):
...
@@ -33,7 +33,7 @@ class Rule(models.Model):
blank
=
False
,
verbose_name
=
_
(
"direction"
),
blank
=
False
,
verbose_name
=
_
(
"direction"
),
help_text
=
_
(
"If the rule matches egress "
help_text
=
_
(
"If the rule matches egress "
"or ingress packets."
))
"or ingress packets."
))
description
=
models
.
TextField
(
blank
=
True
,
description
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
_
(
'description'
),
help_text
=
_
(
"Why is the rule needed, "
help_text
=
_
(
"Why is the rule needed, "
"or how does it work."
))
"or how does it work."
))
foreign_network
=
models
.
ForeignKey
(
foreign_network
=
models
.
ForeignKey
(
...
@@ -572,19 +572,23 @@ class Host(models.Model):
...
@@ -572,19 +572,23 @@ class Host(models.Model):
class
Firewall
(
models
.
Model
):
class
Firewall
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
)
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
,
verbose_name
=
_
(
'name'
))
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
self
.
name
return
self
.
name
class
Domain
(
models
.
Model
):
class
Domain
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
40
,
validators
=
[
val_domain
])
name
=
models
.
CharField
(
max_length
=
40
,
validators
=
[
val_domain
],
owner
=
models
.
ForeignKey
(
User
)
verbose_name
=
_
(
'name'
))
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
owner
=
models
.
ForeignKey
(
User
,
verbose_name
=
_
(
'owner'
))
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
,
ttl
=
models
.
IntegerField
(
default
=
600
)
verbose_name
=
_
(
'created_at'
))
description
=
models
.
TextField
(
blank
=
True
)
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
_
(
'modified_at'
))
ttl
=
models
.
IntegerField
(
default
=
600
,
verbose_name
=
_
(
'ttl'
))
description
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
_
(
'description'
))
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
self
.
name
return
self
.
name
...
@@ -598,16 +602,21 @@ class Record(models.Model):
...
@@ -598,16 +602,21 @@ class Record(models.Model):
CHOICES_type
=
((
'A'
,
'A'
),
(
'CNAME'
,
'CNAME'
),
(
'AAAA'
,
'AAAA'
),
CHOICES_type
=
((
'A'
,
'A'
),
(
'CNAME'
,
'CNAME'
),
(
'AAAA'
,
'AAAA'
),
(
'MX'
,
'MX'
),
(
'NS'
,
'NS'
),
(
'PTR'
,
'PTR'
),
(
'TXT'
,
'TXT'
))
(
'MX'
,
'MX'
),
(
'NS'
,
'NS'
),
(
'PTR'
,
'PTR'
),
(
'TXT'
,
'TXT'
))
name
=
models
.
CharField
(
max_length
=
40
,
validators
=
[
val_domain
],
name
=
models
.
CharField
(
max_length
=
40
,
validators
=
[
val_domain
],
blank
=
True
,
null
=
True
)
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
'name'
))
domain
=
models
.
ForeignKey
(
'Domain'
)
domain
=
models
.
ForeignKey
(
'Domain'
,
verbose_name
=
_
(
'domain'
))
host
=
models
.
ForeignKey
(
'Host'
,
blank
=
True
,
null
=
True
)
host
=
models
.
ForeignKey
(
'Host'
,
blank
=
True
,
null
=
True
,
type
=
models
.
CharField
(
max_length
=
6
,
choices
=
CHOICES_type
)
verbose_name
=
_
(
'host'
))
address
=
models
.
CharField
(
max_length
=
40
,
blank
=
True
,
null
=
True
)
type
=
models
.
CharField
(
max_length
=
6
,
choices
=
CHOICES_type
,
ttl
=
models
.
IntegerField
(
default
=
600
)
verbose_name
=
_
(
'type'
))
owner
=
models
.
ForeignKey
(
User
)
address
=
models
.
CharField
(
max_length
=
40
,
blank
=
True
,
null
=
True
,
description
=
models
.
TextField
(
blank
=
True
)
verbose_name
=
_
(
'address'
))
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
ttl
=
models
.
IntegerField
(
default
=
600
,
verbose_name
=
_
(
'ttl'
))
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
)
owner
=
models
.
ForeignKey
(
User
,
verbose_name
=
_
(
'owner'
))
description
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
_
(
'description'
))
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
_
(
'created_at'
))
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
_
(
'modified_at'
))
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
self
.
desc
()
return
self
.
desc
()
...
@@ -717,15 +726,21 @@ class Blacklist(models.Model):
...
@@ -717,15 +726,21 @@ class Blacklist(models.Model):
CHOICES_type
=
((
'permban'
,
'permanent ban'
),
(
'tempban'
,
'temporary ban'
),
CHOICES_type
=
((
'permban'
,
'permanent ban'
),
(
'tempban'
,
'temporary ban'
),
(
'whitelist'
,
'whitelist'
),
(
'tempwhite'
,
'tempwhite'
))
(
'whitelist'
,
'whitelist'
),
(
'tempwhite'
,
'tempwhite'
))
ipv4
=
models
.
GenericIPAddressField
(
protocol
=
'ipv4'
,
unique
=
True
)
ipv4
=
models
.
GenericIPAddressField
(
protocol
=
'ipv4'
,
unique
=
True
)
host
=
models
.
ForeignKey
(
'Host'
,
blank
=
True
,
null
=
True
)
host
=
models
.
ForeignKey
(
'Host'
,
blank
=
True
,
null
=
True
,
reason
=
models
.
TextField
(
blank
=
True
)
verbose_name
=
_
(
'host'
))
snort_message
=
models
.
TextField
(
blank
=
True
)
reason
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
_
(
'reason'
))
snort_message
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
_
(
'short message'
))
type
=
models
.
CharField
(
type
=
models
.
CharField
(
max_length
=
10
,
max_length
=
10
,
choices
=
CHOICES_type
,
choices
=
CHOICES_type
,
default
=
'tempban'
)
default
=
'tempban'
,
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
verbose_name
=
_
(
'type'
)
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
)
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
_
(
'created_at'
))
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
_
(
'modified_at'
))
def
save
(
self
,
*
args
,
**
kwargs
):
def
save
(
self
,
*
args
,
**
kwargs
):
self
.
full_clean
()
self
.
full_clean
()
...
...
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