From 6e8004bfd0c07b25138563d2693d2839b70797bc Mon Sep 17 00:00:00 2001 From: Levi Date: Wed, 4 May 2016 22:06:49 -0500 Subject: [PATCH] Changed hostingorder to m2m with vm plan model --- hosting/migrations/0013_auto_20160505_0302.py | 21 +++++++++++++++++++ hosting/models.py | 2 +- hosting/test_views.py | 0 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 hosting/migrations/0013_auto_20160505_0302.py create mode 100644 hosting/test_views.py diff --git a/hosting/migrations/0013_auto_20160505_0302.py b/hosting/migrations/0013_auto_20160505_0302.py new file mode 100644 index 00000000..ac4cd8e5 --- /dev/null +++ b/hosting/migrations/0013_auto_20160505_0302.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2016-05-05 03:02 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('hosting', '0012_auto_20160501_1850'), + ] + + operations = [ + migrations.AlterField( + model_name='hostingorder', + name='VMPlan', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hosting.VirtualMachinePlan'), + ), + ] diff --git a/hosting/models.py b/hosting/models.py index ea650ebb..51930a12 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -110,7 +110,7 @@ class HostingOrder(models.Model): ORDER_APPROVED_STATUS = 'Approved' ORDER_DECLINED_STATUS = 'Declined' - VMPlan = models.OneToOneField(VirtualMachinePlan) + VMPlan = models.ForeignKey(VirtualMachinePlan) customer = models.ForeignKey(StripeCustomer) billing_address = models.ForeignKey(BillingAddress) created_at = models.DateTimeField(auto_now_add=True) diff --git a/hosting/test_views.py b/hosting/test_views.py new file mode 100644 index 00000000..e69de29b