- fix question mark for questions
- create some blank users
- added run all function to do all the setup required
main
Guy Davis 9 months ago
parent 9ac3a875b8
commit addd73609b

@ -13,7 +13,7 @@ def populate():
for i in range(number_of_polls): for i in range(number_of_polls):
poll = Poll() poll = Poll()
question = data_maker.sentence() question = data_maker.sentence()
question.replace(".", "?") question = question.replace(".", "?")
poll.question = question poll.question = question
poll.save() poll.save()
@ -52,3 +52,20 @@ def create_users_and_votes():
vote.option = Option.objects.get(pk=option_id) vote.option = Option.objects.get(pk=option_id)
vote.user = user vote.user = user
vote.save() vote.save()
def create_blank_users():
from django.contrib.auth.models import User
users_to_create = 16
for i in range(users_to_create):
User.objects.create_user(
f"user{i}",
password="password",
)
def run_all():
populate()
create_users_and_votes()
create_blank_users()

Loading…
Cancel
Save

Powered by TurnKey Linux.