Exemplo n.º 1
0
# Usage:
# python manage.py makemigrations
# python manage.py migrate
# python manage.py < populateDatabase.py

from conversations.models import Message
m = Message(text="This was a triumph", user_id=1)
m.save()
m2 = Message(text="I'm making a note here…", parent=m, user_id=1)
m2.save()
m3 = Message(text="Huge success", parent=m, user_id=1)
m3.save()
m4 = Message(text="It's hard to overstate my satisfaction", parent=m2, user_id=1)
m4.save()
Exemplo n.º 2
0
user2 = User.objects.create_user('clara', '[email protected]', 'clarapassword')
user2.first_name = "Clara"
user2.last_name = "Ness"
user2.save()

user3 = User.objects.create_user('joe', '[email protected]', 'joepassword')
user3.first_name = "Joe"
user3.last_name = "Pohlman"
user3.save()

user4 = User.objects.create_user('brendan', '[email protected]', 'brendanpassword')
user4.first_name = "Brendan"
user4.last_name = "Killalea"
user4.save()

# Add some messages
m1 = Message(text="ROOT 1", user=user1)
m1.save()
m2 = Message(text="1st CHILD OF ROOT 1", user=user2, parent=m1)
m2.save()
m3 = Message(text="2nd CHILD OF ROOT 1", user=user1, parent=m1)
m3.save()
m4 = Message(text="A descendant of root 1", user=user1, parent=m2)
m4.save()
m5 = Message(text="Another descendant of root 1", user=user2, parent=m3)
m5.save()
m6 = Message(text="Yet another descendant of root 1", user=user2, parent=m2)
m6.save()

m7 = Message(text="ROOT2", user=user4)
m7.save()
Exemplo n.º 3
0
user2 = User.objects.create_user('clara', '[email protected]', 'clarapassword')
user2.first_name = "Clara"
user2.last_name = "Nees"
user2.save()

user3 = User.objects.create_user('joe', '[email protected]', 'joepassword')
user3.first_name = "Joe"
user3.last_name = "Pohlman"
user3.save()

user4 = User.objects.create_user('brendan', '[email protected]', 'brendanpassword')
user4.first_name = "Brendan"
user4.last_name = "Killalea"
user4.save()

b1 = Message(topic="Book Club", text="What should we read this month?", user=user1)
b1.save()
b2 = Message(text="Sci-fi!", parent=b1, user=u)
b2.save()
b3 = Message(text="Eh, how about something angsty with more symbolism than plot and an unsatisfactory ending?", parent=b2, user=user2)
b3.save()
b4 = Message(text="Ooh, fun! Misery is the best! Let's read something by Steinbeck!", parent=b3, user=user3)
b4.save()
b5 = Message(text="War and Peace!", parent=b3, user=user3)
b5.save()
b6 = Message(text="Staaaaaahhhhhhhp.", parent=b3, user=u)
b6.save()
b7 = Message(text="Dictionary, by Daniel Webster", parent=b1, user=user4)
b7.save()
b8 = Message(text="Diccionario de la lengua española - Edición del Tricentenario", parent=b7, user=user3)
b8.save()
Exemplo n.º 4
0
user2 = User.objects.create_user('clara', '[email protected]', 'clarapassword')
user2.first_name = "Clara"
user2.last_name = "Nees"
user2.save()

user3 = User.objects.create_user('joe', '[email protected]', 'joepassword')
user3.first_name = "Joe"
user3.last_name = "Pohlman"
user3.save()

user4 = User.objects.create_user('brendan', '[email protected]', 'brendanpassword')
user4.first_name = "Brendan"
user4.last_name = "Killalea"
user4.save()

n1 = Message(topic="Good Nerf Guns?", text="I'm looking for some advice on dart based ballistics.", user=user1)
n1.save()
n2 = Message(user=user2, parent=n1, text="Dude, totally depends on what you're using for? We looking for a casual game of sissy darts or you wanna deal some real dammage?")
n2.save()
n3 = Message(user=user3, parent=n1, text="Maverick all the way")
n3.save()
n4 = Message(user=user1, parent=n2, text="There's this academic researcher that needs to be put in his place, I'm looking to bring the pain!")
n4.save()
n5 = Message(user=user2, parent=n4, text="The RapidStrike CS-18 is gonna be the best choice for you, you nefarious guy you.")
n5.save()
n6 = Message(user=user1, parent=n5, text="Nice! He'll never see it coming!.")
n6.save()
n7 = Message(user=user4, parent=n4, text="Lol, you should just hack his website or something. The duck flies at midnight, amiright!?")
n7.save()
n7 = Message(user=user3, parent=n4, text="Hey man, be careful whatever you do. You'd be surprised at how easy it is to track someones actions even if they try to delete their search histories and flee the country.")
n7.save()