Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4384f55d
authored
Jan 28, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: add date fields
parent
00581971
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
firewall/migrations/0021_auto__add_field_host_created_at__add_field_host_modified_at__add_field.py
+0
-0
firewall/models.py
+11
-0
No files found.
firewall/migrations/0021_auto__add_field_host_created_at__add_field_host_modified_at__add_field.py
0 → 100644
View file @
4384f55d
This diff is collapsed.
Click to expand it.
firewall/models.py
View file @
4384f55d
...
@@ -31,6 +31,8 @@ class Rule(models.Model):
...
@@ -31,6 +31,8 @@ class Rule(models.Model):
r_type
=
models
.
CharField
(
max_length
=
10
,
choices
=
CHOICES_type
)
r_type
=
models
.
CharField
(
max_length
=
10
,
choices
=
CHOICES_type
)
nat
=
models
.
BooleanField
(
default
=
False
)
nat
=
models
.
BooleanField
(
default
=
False
)
nat_dport
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
,
validators
=
[
MinValueValidator
(
1
),
MaxValueValidator
(
65535
)])
nat_dport
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
,
validators
=
[
MinValueValidator
(
1
),
MaxValueValidator
(
65535
)])
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
self
.
desc
()
return
self
.
desc
()
...
@@ -79,6 +81,8 @@ class Vlan(models.Model):
...
@@ -79,6 +81,8 @@ class Vlan(models.Model):
comment
=
models
.
TextField
(
blank
=
True
)
comment
=
models
.
TextField
(
blank
=
True
)
domain
=
models
.
TextField
(
blank
=
True
,
validators
=
[
val_domain
])
domain
=
models
.
TextField
(
blank
=
True
,
validators
=
[
val_domain
])
dhcp_pool
=
models
.
TextField
(
blank
=
True
)
dhcp_pool
=
models
.
TextField
(
blank
=
True
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
self
.
name
return
self
.
name
...
@@ -100,6 +104,8 @@ class Vlan(models.Model):
...
@@ -100,6 +104,8 @@ class Vlan(models.Model):
class
Group
(
models
.
Model
):
class
Group
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
)
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
)
rules
=
models
.
ManyToManyField
(
'Rule'
,
symmetrical
=
False
,
blank
=
True
,
null
=
True
)
rules
=
models
.
ManyToManyField
(
'Rule'
,
symmetrical
=
False
,
blank
=
True
,
null
=
True
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
self
.
name
return
self
.
name
...
@@ -107,6 +113,9 @@ class Group(models.Model):
...
@@ -107,6 +113,9 @@ class Group(models.Model):
class
Alias
(
models
.
Model
):
class
Alias
(
models
.
Model
):
host
=
models
.
ForeignKey
(
'Host'
)
host
=
models
.
ForeignKey
(
'Host'
)
alias
=
models
.
CharField
(
max_length
=
40
,
unique
=
True
,
validators
=
[
val_domain
])
alias
=
models
.
CharField
(
max_length
=
40
,
unique
=
True
,
validators
=
[
val_domain
])
owner
=
models
.
ForeignKey
(
User
,
null
=
True
,
blank
=
True
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
)
class
Meta
:
class
Meta
:
verbose_name_plural
=
'aliases'
verbose_name_plural
=
'aliases'
...
@@ -125,6 +134,8 @@ class Host(models.Model):
...
@@ -125,6 +134,8 @@ class Host(models.Model):
owner
=
models
.
ForeignKey
(
User
)
owner
=
models
.
ForeignKey
(
User
)
groups
=
models
.
ManyToManyField
(
'Group'
,
symmetrical
=
False
,
blank
=
True
,
null
=
True
)
groups
=
models
.
ManyToManyField
(
'Group'
,
symmetrical
=
False
,
blank
=
True
,
null
=
True
)
rules
=
models
.
ManyToManyField
(
'Rule'
,
symmetrical
=
False
,
blank
=
True
,
null
=
True
)
rules
=
models
.
ManyToManyField
(
'Rule'
,
symmetrical
=
False
,
blank
=
True
,
null
=
True
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
self
.
hostname
return
self
.
hostname
...
...
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