Commit d18f5ba5 by Belákovics Ádám

Merged instance and image basic models

parent c5df7cd4
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class ImageConfig(AppConfig):
name = 'image'
from django.db import models
class Disk():
"""A virtual disk.
"""
name = models.CharField(blank=True, max_length=100, verbose_name="name", help_text="Name of the disk")
remote_ID = models.CharField(max_length=40, unique=True, verbose_name="remote_ID", help_text="ID, which helps access the disk")
\ No newline at end of file
from rest_framework import serializers
from .models import Disk
class DiskSerializer(serializers.ModelSerializer):
class Meta:
model = Disk
fields = ('name', 'remote_ID',)
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
...@@ -34,6 +34,7 @@ ALLOWED_HOSTS = [ ...@@ -34,6 +34,7 @@ ALLOWED_HOSTS = [
INSTALLED_APPS = [ INSTALLED_APPS = [
'instance.apps.InstanceConfig', 'instance.apps.InstanceConfig',
'image.apps.ImageConfig',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
......
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class StorageConfig(AppConfig):
name = 'storage'
from django.db import models
# Create your models here.
class DataStore():
"""Collection of virtual disks.
"""
name = models.CharField(max_length=100, unique=True, verbose_name="name", help_text="Name of the data store.")
remote_ID = models.CharField(max_length=40, unique=True, verbose_name="remote_ID", help_text="ID, which helps access the data store.")
#vm
\ No newline at end of file
from rest_framework import serializers
from .models import DataStore
class DataStoreSerializer(serializers.ModelSerializer):
class Meta:
model = DataStore
fields = ('name', 'remote_ID',)
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class TemplateConfig(AppConfig):
name = 'template'
from django.db import models
class InstanceTemplate():
"""Virtual machine template.
"""
name = models.CharField(max_length=100, verbose_name="name",
help_text="Human readable name of template.")
description = models.TextField(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.")
\ No newline at end of file
from rest_framework import serializers
from .models import InstanceTemplate
class InstanceTemplateSerializer(serializers.ModelSerializer):
class Meta:
model = InstanceTemplate
fields = ('name', 'description', 'owner', 'remote_ID',)
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
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