Commit 2b3bf428 by Bodor Máté

Create template model and install falke8

parent 415ba749
......@@ -6,6 +6,7 @@ verify_ssl = true
[dev-packages]
httpie = "*"
django-rest-swagger = "*"
flake8 = "*"
[packages]
django = "*"
......
from django.db import models
from images.models import Disk
class InstanceTemplate:
class BaseTemplate(models.Model):
"""Virtual machine template.
"""
......@@ -9,15 +11,39 @@ class InstanceTemplate:
name = models.CharField(
max_length=100,
verbose_name="name",
help_text="Human readable name of template.",
help_text="Human readable name of template."
)
description = models.TextField(
verbose_name="description", blank=True, help_text="Description of the template."
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.",
help_text="ID, which helps access the template."
)
created_at = models.DateTimeField(
auto_now_add=True,
editable=False,
help_text="Date, when the template created."
)
class Template(BaseTemplate):
disk = models.ForeignKey(
Disk,
related_name="templates",
on_delete=models.CASCADE,
help_text="The disk where the template is located."
)
# class PureTemplate(BaseTemplate):
# images = modesl.ForeignKey(
# Image,
# related_name="templates",
# on_delete=models.CASCADE
# )
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