Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
30cfa8a5
Commit
30cfa8a5
authored
Jan 10, 2015
by
guanghongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asset models
parent
67074fa8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
models.py
jasset/models.py
+5
-3
No files found.
jasset/models.py
View file @
30cfa8a5
import
datetime
from
django.db
import
models
from
juser.models
import
Group
,
User
from
juser.models
import
Group
as
UserGroup
class
IDC
(
models
.
Model
):
...
...
@@ -10,6 +10,7 @@ class IDC(models.Model):
def
__unicode__
(
self
):
return
self
.
name
class
Group
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
80
,
unique
=
True
)
comment
=
models
.
CharField
(
max_length
=
160
,
blank
=
True
,
null
=
True
)
...
...
@@ -28,13 +29,14 @@ class Asset(models.Model):
ip
=
models
.
IPAddressField
(
unique
=
True
)
port
=
models
.
SmallIntegerField
(
max_length
=
5
)
idc
=
models
.
ForeignKey
(
IDC
)
group
=
models
.
ManyToManyField
(
Group
)
user_group
=
models
.
ManyToManyField
(
UserGroup
)
bis_group
=
models
.
ManyToManyField
(
Group
)
login_type
=
models
.
CharField
(
max_length
=
1
,
choices
=
LOGIN_TYPE_CHOICES
,
default
=
'L'
)
username_common
=
models
.
CharField
(
max_length
=
20
,
blank
=
True
,
null
=
True
)
password_common
=
models
.
CharField
(
max_length
=
80
,
blank
=
True
,
null
=
True
)
username_super
=
models
.
CharField
(
max_length
=
20
,
blank
=
True
,
null
=
True
)
password_super
=
models
.
CharField
(
max_length
=
80
,
blank
=
True
,
null
=
True
)
date_added
=
models
.
DateTimeField
(
auto_now
=
True
,
default
=
datetime
.
datetime
.
now
(),
null
=
True
)
date_added
=
models
.
DateTimeField
(
auto_now
=
True
,
default
=
datetime
.
datetime
.
now
(),
null
=
True
)
is_active
=
models
.
BooleanField
(
default
=
True
)
comment
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
...
...
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