seed file data jut needs to be linked somehow

This commit is contained in:
Elijah Lucian 2021-07-15 23:17:26 -06:00
parent 4cfdd5a677
commit fbabf850f2

View File

@ -8,6 +8,7 @@ class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write('clearing and seeding database...')
# create test users
User.objects.all().delete()
elijah = User(username="elijah",
email="elijah@westwinds.io",
@ -22,19 +23,27 @@ class Command(BaseCommand):
self.stdout.write(str(User.objects.all()))
self.stdout.write('Users Created!')
# create an account that all 3 users are attached to
Account.objects.all().delete()
home = Account(name="home", details="home stacks",
income=4000, expenses=2000).save()
self.stdout.write(str(Account.objects.all()))
self.stdout.write('Accounts Created!')
# create seed accounts
# Home Account
# $3000
# - home expenses
# create test stacks for account
Stack.objects.all().delete()
# create test stacks
# - name: shit
groceries = Stack(name="Groceries",
details="",
amount=800).save()
takeout = Stack(name="Date Nights",
details="",
amount=400).save()
shit = Stack(name="Crap",
details="",
amount=500).save()
Transaction.objects.all().delete()
# generate transaction history