Set default and on_delete attributes
This commit is contained in:
parent
f48005166e
commit
7f57ace92d
2 changed files with 11 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.4 on 2018-07-01 16:31
|
||||
# Generated by Django 1.9.4 on 2018-07-01 17:18
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
@ -23,13 +23,13 @@ class Migration(migrations.Migration):
|
|||
('memory', models.IntegerField(default=0)),
|
||||
('hdd_size', models.IntegerField(default=0)),
|
||||
('ssd_size', models.IntegerField(default=0)),
|
||||
('vm_template', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='datacenterlight.VMTemplate')),
|
||||
('vm_template', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='datacenterlight.VMTemplate')),
|
||||
],
|
||||
bases=(utils.mixins.AssignPermissionsMixin, models.Model),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='hostingorder',
|
||||
name='order_specs',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='hosting.OrderSpecifications'),
|
||||
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='hosting.OrderSpecifications'),
|
||||
),
|
||||
]
|
|
@ -42,7 +42,10 @@ class HostingPlan(models.Model):
|
|||
|
||||
|
||||
class OrderSpecifications(AssignPermissionsMixin, models.Model):
|
||||
vm_template = models.ForeignKey(VMTemplate, blank=True, null=True)
|
||||
vm_template = models.ForeignKey(
|
||||
VMTemplate, blank=True, null=True, default=None,
|
||||
on_delete=models.SET_NULL
|
||||
)
|
||||
cores = models.IntegerField(default=0)
|
||||
memory = models.IntegerField(default=0)
|
||||
hdd_size = models.IntegerField(default=0)
|
||||
|
@ -69,7 +72,10 @@ class HostingOrder(AssignPermissionsMixin, models.Model):
|
|||
price = models.FloatField()
|
||||
subscription_id = models.CharField(max_length=100, null=True)
|
||||
vm_pricing = models.ForeignKey(VMPricing)
|
||||
order_specs = models.ForeignKey(OrderSpecifications, null=True, blank=True)
|
||||
order_specs = models.ForeignKey(
|
||||
OrderSpecifications, null=True, blank=True, default=None,
|
||||
on_delete=models.SET_NULL
|
||||
)
|
||||
|
||||
permissions = ('view_hostingorder',)
|
||||
|
||||
|
|
Loading…
Reference in a new issue