Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
11
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
da8d47a4
authored
Jul 03, 2019
by
Bodor Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create template model and install falke8
parent
380211d5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
12 deletions
+37
-12
Pipfile
+2
-1
Pipfile.lock
+5
-7
recircle/template/models.py
+30
-4
No files found.
Pipfile
View file @
da8d47a4
...
...
@@ -18,4 +18,4 @@ python-novaclient = "*"
keystoneauth1 = "*"
[requires]
python_ver
sion = "3.6"
python_ver
\ No newline at end of file
Pipfile.lock
View file @
da8d47a4
{
"_meta": {
"hash": {
"sha256": "
b00ba9882fe44a9e7e69f6b395f0790ba52f85f1e8ee2b116c599b4d6ce88401
"
"sha256": "
134400991075a84d52a9eeffd14ebe96b1b33fc180b2948203df04c1cdf27990
"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.6"
},
"requires": {},
"sources": [
{
"name": "pypi",
...
...
@@ -485,11 +483,11 @@
},
"flake8": {
"hashes": [
"sha256:
859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661
",
"sha256:
a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8
"
"sha256:
19241c1cbc971b9962473e4438a2ca19749a7dd002dd1a946eaba171b4114548
",
"sha256:
8e9dfa3cecb2400b3738a42c54c3043e821682b9c840b0448c0503f781130696
"
],
"index": "pypi",
"version": "==3.7.
7
"
"version": "==3.7.
8
"
},
"httpie": {
"hashes": [
...
...
recircle/template/models.py
View file @
da8d47a4
from
django.db
import
models
from
images.models
import
Disk
class
InstanceTemplate
:
class
BaseTemplate
(
models
.
Model
):
"""Virtual machine template.
"""
...
...
@@ -9,15 +11,39 @@ class InstanceTemplate:
name
=
models
.
CharField
(
max_length
=
100
,
verbose_name
=
"name"
,
help_text
=
"Human readable name of template."
,
help_text
=
"Human readable name of template."
)
description
=
models
.
TextField
(
verbose_name
=
"description"
,
blank
=
True
,
help_text
=
"Description of the template."
verbose_name
=
"description"
,
blank
=
True
,
help_text
=
"Description of the template."
)
# owner = models.ForeignKey(User)
remote_ID
=
models
.
CharField
(
max_length
=
40
,
unique
=
True
,
verbose_name
=
"remote_ID"
,
help_text
=
"ID, which helps access the template."
,
help_text
=
"ID, which helps access the template."
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
,
editable
=
False
,
help_text
=
"Date, when the template created."
)
class
Template
(
BaseTemplate
):
disk
=
models
.
ForeignKey
(
Disk
,
related_name
=
"templates"
,
on_delete
=
models
.
CASCADE
,
help_text
=
"The disk where the template is located."
)
# class PureTemplate(BaseTemplate):
# images = modesl.ForeignKey(
# Image,
# related_name="templates",
# on_delete=models.CASCADE
# )
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