Commit 4ec1fa80 by Bodor Máté

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

parent da8d47a4
.vscode/
recircle/db.sqlite3
interface-openstack/
recircle/clouds.yaml
recircle/implementation/
recircle/interface/
recircle/interface_openstack/
environment.sh
from image.models import Disk
from image.serializers import DiskSerializer
# from django.shortcuts import render
from rest_framework.views import APIView
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 (
OpenstackImageManager,
)
from django.conf import settings
class DiskList(APIView):
......
......@@ -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