Commit 4a001965 by Bodor Máté

Register template app to django setting, create migrations, add *.sh to gitignore

parent 2b3bf428
......@@ -5,3 +5,4 @@ recircle/clouds.yaml
recircle/implementation/
recircle/interface/
recircle/interface_openstack/
*.sh
......@@ -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 interface_openstack.implementation.image.OpenstackImageManager import (
from implementation.image.OpenstackImageManager import (
OpenstackImageManager,
)
import openstack
......
......@@ -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 interface_openstack.implementation.vm.instance import OSVirtualMachineManager
from implementation.vm.instance import OSVirtualMachineManager
import openstack
import datetime
......
......@@ -42,6 +42,7 @@ INSTALLED_APPS = [
"djoser",
"rest_framework_swagger",
"corsheaders",
"template",
]
MIDDLEWARE = [
......
# 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',),
),
]
from django.db import models
from images.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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment