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
4ec1fa80
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
da8d47a4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
9 deletions
+40
-9
.gitignore
+0
-4
recircle/image/views.py
+3
-3
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 @
4ec1fa80
.vscode/
.vscode/
recircle/db.sqlite3
recircle/db.sqlite3
interface-openstack/
recircle/clouds.yaml
recircle/clouds.yaml
recircle/implementation/
recircle/interface/
recircle/interface_openstack/
environment.sh
environment.sh
recircle/image/views.py
View file @
4ec1fa80
from
image.models
import
Disk
from
image.serializers
import
DiskSerializer
# from django.shortcuts import render
# from django.shortcuts import render
from
rest_framework.views
import
APIView
from
rest_framework.views
import
APIView
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
django.conf
import
settings
from
image.serializers
import
DiskSerializer
from
image.models
import
Disk
from
interface_openstack.implementation.image.openstack_image_manager
import
(
from
interface_openstack.implementation.image.openstack_image_manager
import
(
OpenstackImageManager
,
OpenstackImageManager
,
)
)
from
django.conf
import
settings
class
DiskList
(
APIView
):
class
DiskList
(
APIView
):
...
...
recircle/recircle/settings.py
View file @
4ec1fa80
...
@@ -42,6 +42,7 @@ INSTALLED_APPS = [
...
@@ -42,6 +42,7 @@ INSTALLED_APPS = [
"djoser"
,
"djoser"
,
"rest_framework_swagger"
,
"rest_framework_swagger"
,
"corsheaders"
,
"corsheaders"
,
"template"
,
]
]
MIDDLEWARE
=
[
MIDDLEWARE
=
[
...
...
recircle/template/migrations/0001_initial.py
0 → 100644
View file @
4ec1fa80
# 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 @
4ec1fa80
from
django.db
import
models
from
django.db
import
models
from
image
s
.models
import
Disk
from
image.models
import
Disk
class
BaseTemplate
(
models
.
Model
):
class
BaseTemplate
(
models
.
Model
):
...
@@ -18,7 +18,6 @@ class BaseTemplate(models.Model):
...
@@ -18,7 +18,6 @@ class BaseTemplate(models.Model):
blank
=
True
,
blank
=
True
,
help_text
=
"Description of the template."
help_text
=
"Description of the template."
)
)
# owner = models.ForeignKey(User)
remote_ID
=
models
.
CharField
(
remote_ID
=
models
.
CharField
(
max_length
=
40
,
max_length
=
40
,
unique
=
True
,
unique
=
True
,
...
@@ -30,6 +29,7 @@ class BaseTemplate(models.Model):
...
@@ -30,6 +29,7 @@ class BaseTemplate(models.Model):
editable
=
False
,
editable
=
False
,
help_text
=
"Date, when the template created."
help_text
=
"Date, when the template created."
)
)
# owner = models.ForeignKey(User)
class
Template
(
BaseTemplate
):
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