Commit da8d47a4 by Bodor Máté

Create template model and install falke8

parent 380211d5
...@@ -18,4 +18,4 @@ python-novaclient = "*" ...@@ -18,4 +18,4 @@ python-novaclient = "*"
keystoneauth1 = "*" keystoneauth1 = "*"
[requires] [requires]
python_version = "3.6" python_ver
\ No newline at end of file
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "b00ba9882fe44a9e7e69f6b395f0790ba52f85f1e8ee2b116c599b4d6ce88401" "sha256": "134400991075a84d52a9eeffd14ebe96b1b33fc180b2948203df04c1cdf27990"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {},
"python_version": "3.6"
},
"sources": [ "sources": [
{ {
"name": "pypi", "name": "pypi",
...@@ -485,11 +483,11 @@ ...@@ -485,11 +483,11 @@
}, },
"flake8": { "flake8": {
"hashes": [ "hashes": [
"sha256:859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", "sha256:19241c1cbc971b9962473e4438a2ca19749a7dd002dd1a946eaba171b4114548",
"sha256:a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8" "sha256:8e9dfa3cecb2400b3738a42c54c3043e821682b9c840b0448c0503f781130696"
], ],
"index": "pypi", "index": "pypi",
"version": "==3.7.7" "version": "==3.7.8"
}, },
"httpie": { "httpie": {
"hashes": [ "hashes": [
......
from django.db import models from django.db import models
from images.models import Disk
class InstanceTemplate:
class BaseTemplate(models.Model):
"""Virtual machine template. """Virtual machine template.
""" """
...@@ -9,15 +11,39 @@ class InstanceTemplate: ...@@ -9,15 +11,39 @@ class InstanceTemplate:
name = models.CharField( name = models.CharField(
max_length=100, max_length=100,
verbose_name="name", verbose_name="name",
help_text="Human readable name of template.", help_text="Human readable name of template."
) )
description = models.TextField( 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) # owner = models.ForeignKey(User)
remote_ID = models.CharField( remote_ID = models.CharField(
max_length=40, max_length=40,
unique=True, unique=True,
verbose_name="remote_ID", 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