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
4a001965
authored
Jul 03, 2019
by
Bodor Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Register template app to django setting, create migrations, add *.sh to gitignore
parent
2b3bf428
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
4 deletions
+40
-4
.gitignore
+1
-0
recircle/image/views.py
+1
-1
recircle/instance/views.py
+1
-1
recircle/recircle/settings.py
+1
-0
recircle/template/migrations/0001_initial.py
+34
-0
recircle/template/models.py
+2
-2
No files found.
.gitignore
View file @
4a001965
...
...
@@ -5,3 +5,4 @@ recircle/clouds.yaml
recircle/implementation/
recircle/interface/
recircle/interface_openstack/
*.sh
recircle/image/views.py
View file @
4a001965
...
...
@@ -3,7 +3,7 @@ from image.serializers import DiskSerializer
# from django.shortcuts import render
from
rest_framework.views
import
APIView
from
rest_framework.response
import
Response
from
i
nterface_openstack.i
mplementation.image.OpenstackImageManager
import
(
from
implementation.image.OpenstackImageManager
import
(
OpenstackImageManager
,
)
import
openstack
...
...
recircle/instance/views.py
View file @
4a001965
...
...
@@ -4,7 +4,7 @@ from django.http import Http404
from
rest_framework.views
import
APIView
from
rest_framework.response
import
Response
from
rest_framework
import
status
from
i
nterface_openstack.i
mplementation.vm.instance
import
OSVirtualMachineManager
from
implementation.vm.instance
import
OSVirtualMachineManager
import
openstack
import
datetime
...
...
recircle/recircle/settings.py
View file @
4a001965
...
...
@@ -42,6 +42,7 @@ INSTALLED_APPS = [
"djoser"
,
"rest_framework_swagger"
,
"corsheaders"
,
"template"
,
]
MIDDLEWARE
=
[
...
...
recircle/template/migrations/0001_initial.py
0 → 100644
View file @
4a001965
# Generated by Django 2.2.3 on 2019-07-03 12:09
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
(
'image'
,
'0001_initial'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'BaseTemplate'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'name'
,
models
.
CharField
(
help_text
=
'Human readable name of template.'
,
max_length
=
100
,
verbose_name
=
'name'
)),
(
'description'
,
models
.
TextField
(
blank
=
True
,
help_text
=
'Description of the template.'
,
verbose_name
=
'description'
)),
(
'remote_ID'
,
models
.
CharField
(
help_text
=
'ID, which helps access the template.'
,
max_length
=
40
,
unique
=
True
,
verbose_name
=
'remote_ID'
)),
(
'created_at'
,
models
.
DateTimeField
(
auto_now_add
=
True
,
help_text
=
'Date, when the template created.'
)),
],
),
migrations
.
CreateModel
(
name
=
'Template'
,
fields
=
[
(
'basetemplate_ptr'
,
models
.
OneToOneField
(
auto_created
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
parent_link
=
True
,
primary_key
=
True
,
serialize
=
False
,
to
=
'template.BaseTemplate'
)),
(
'disk'
,
models
.
ForeignKey
(
help_text
=
'The disk where the template is located.'
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'templates'
,
to
=
'image.Disk'
)),
],
bases
=
(
'template.basetemplate'
,),
),
]
recircle/template/models.py
View file @
4a001965
from
django.db
import
models
from
image
s
.models
import
Disk
from
image.models
import
Disk
class
BaseTemplate
(
models
.
Model
):
...
...
@@ -18,7 +18,6 @@ class BaseTemplate(models.Model):
blank
=
True
,
help_text
=
"Description of the template."
)
# owner = models.ForeignKey(User)
remote_ID
=
models
.
CharField
(
max_length
=
40
,
unique
=
True
,
...
...
@@ -30,6 +29,7 @@ class BaseTemplate(models.Model):
editable
=
False
,
help_text
=
"Date, when the template created."
)
# owner = models.ForeignKey(User)
class
Template
(
BaseTemplate
):
...
...
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