From f47fbc89191cc475bd1c4f81f39edcbfe6334ab4 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Tue, 21 Aug 2018 09:15:01 +0100
Subject: [PATCH] Update the seed commands for the new model structure

---
 .../management/commands/seed_community_lab_application.py | 6 ++++--
 .../apply/funds/management/commands/seed_concept_note.py  | 7 ++++---
 .../apply/funds/management/commands/seed_fellowship.py    | 8 +++++---
 .../funds/management/commands/seed_rapid_response.py      | 2 +-
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/opentech/apply/funds/management/commands/seed_community_lab_application.py b/opentech/apply/funds/management/commands/seed_community_lab_application.py
index 68297017b..497b39543 100644
--- a/opentech/apply/funds/management/commands/seed_community_lab_application.py
+++ b/opentech/apply/funds/management/commands/seed_community_lab_application.py
@@ -6,7 +6,9 @@ from django.contrib.auth import get_user_model
 from django.core.management.base import BaseCommand
 from django.db import transaction
 
-from opentech.apply.funds.models import ApplicationForm, LabForm, LabType
+from opentech.apply.funds.models import ApplicationForm, LabType
+from opentech.apply.funds.models.forms import LabBaseForm
+
 from opentech.apply.home.models import ApplyHomePage
 from opentech.apply.users.groups import STAFF_GROUP_NAME
 
@@ -75,7 +77,7 @@ class Command(BaseCommand):
             lab = LabType(title='Community lab', lead=lead, workflow_name='single')
             apply_home.add_child(instance=lab)
 
-            lab_form = LabForm.objects.create(lab=lab, form=application_form)
+            lab_form = LabBaseForm.objects.create(lab=lab, form=application_form)
             lab.forms = [lab_form]
             lab.save()
 
diff --git a/opentech/apply/funds/management/commands/seed_concept_note.py b/opentech/apply/funds/management/commands/seed_concept_note.py
index 40075ddef..579861405 100644
--- a/opentech/apply/funds/management/commands/seed_concept_note.py
+++ b/opentech/apply/funds/management/commands/seed_concept_note.py
@@ -7,7 +7,8 @@ from django.core.management.base import BaseCommand
 from django.db import transaction
 
 from opentech.apply.categories.models import Category
-from opentech.apply.funds.models import ApplicationForm, FundForm, FundType, Round
+from opentech.apply.funds.models import ApplicationForm, FundType, Round
+from opentech.apply.funds.models.forms import ApplicationBaseForm
 from opentech.apply.home.models import ApplyHomePage
 from opentech.apply.users.groups import STAFF_GROUP_NAME
 
@@ -152,8 +153,8 @@ class Command(BaseCommand):
             fund = FundType(title=CN_FUND_TITLE, workflow_name='double')
             apply_home.add_child(instance=fund)
 
-            fund_form = FundForm.objects.create(fund=fund, form=application_form)
-            fund_form2 = FundForm.objects.create(fund=fund, form=proposal_form)
+            fund_form = ApplicationBaseForm.objects.create(application=fund, form=application_form)
+            fund_form2 = ApplicationBaseForm.objects.create(application=fund, form=proposal_form)
             fund.forms = [fund_form, fund_form2]
             fund.save()
 
diff --git a/opentech/apply/funds/management/commands/seed_fellowship.py b/opentech/apply/funds/management/commands/seed_fellowship.py
index 8a1718f02..d0a791b55 100644
--- a/opentech/apply/funds/management/commands/seed_fellowship.py
+++ b/opentech/apply/funds/management/commands/seed_fellowship.py
@@ -7,7 +7,9 @@ from django.core.management.base import BaseCommand
 from django.db import transaction
 
 from opentech.apply.categories.models import Category
-from opentech.apply.funds.models import ApplicationForm, FundForm, FundType, Round
+from opentech.apply.funds.models import ApplicationForm, FundType, Round
+from opentech.apply.funds.models.forms import ApplicationBaseForm
+
 from opentech.apply.home.models import ApplyHomePage
 from opentech.apply.users.groups import STAFF_GROUP_NAME
 
@@ -114,8 +116,8 @@ class Command(BaseCommand):
             fund = FundType(title=FS_FUND_TITLE, workflow_name='double')
             apply_home.add_child(instance=fund)
 
-            fund_form = FundForm.objects.create(fund=fund, form=application_form)
-            fund_form2 = FundForm.objects.create(fund=fund, form=proposal_form)
+            fund_form = ApplicationBaseForm.objects.create(application=fund, form=application_form)
+            fund_form2 = ApplicationBaseForm.objects.create(application=fund, form=proposal_form)
             fund.forms = [fund_form, fund_form2]
             fund.save()
 
diff --git a/opentech/apply/funds/management/commands/seed_rapid_response.py b/opentech/apply/funds/management/commands/seed_rapid_response.py
index b2ed4cb24..b77c6d30b 100644
--- a/opentech/apply/funds/management/commands/seed_rapid_response.py
+++ b/opentech/apply/funds/management/commands/seed_rapid_response.py
@@ -96,7 +96,7 @@ class Command(BaseCommand):
             fund = FundType(title='Rapid Response', workflow_name='single')
             apply_home.add_child(instance=fund)
 
-            fund_form = ApplicationBaseForm.objects.create(fund=fund, form=application_form)
+            fund_form = ApplicationBaseForm.objects.create(application=fund, form=application_form)
             fund.forms = [fund_form]
             fund.save()
 
-- 
GitLab