various updates

This commit is contained in:
Nico Schottelius 2020-10-25 13:52:36 +01:00
commit 8959bc6ad5
7 changed files with 103 additions and 10 deletions

View file

@ -0,0 +1,21 @@
# Generated by Django 3.1 on 2020-10-12 17:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('uncloud_net', '0010_auto_20201011_2009'),
('uncloud', '0004_auto_20201011_2031'),
]
operations = [
migrations.AddField(
model_name='uncloudprovider',
name='coupon_network',
field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='uncloudprovidercoupon', to='uncloud_net.uncloudnetwork'),
preserve_default=False,
),
]

View file

@ -87,6 +87,7 @@ class UncloudProvider(UncloudAddress):
billing_network = models.ForeignKey(UncloudNetwork, related_name="uncloudproviderbill", on_delete=models.CASCADE)
referral_network = models.ForeignKey(UncloudNetwork, related_name="uncloudproviderreferral", on_delete=models.CASCADE)
coupon_network = models.ForeignKey(UncloudNetwork, related_name="uncloudprovidercoupon", on_delete=models.CASCADE)
@classmethod
@ -112,7 +113,8 @@ class UncloudProvider(UncloudAddress):
country="CH",
starting_date=timezone.now(),
billing_network=UncloudNetwork.objects.get(description="uncloud Billing"),
referral_network=UncloudNetwork.objects.get(description="uncloud Referral")
referral_network=UncloudNetwork.objects.get(description="uncloud Referral"),
coupon_network=UncloudNetwork.objects.get(description="uncloud Coupon")
)