This repository was archived by the owner on Sep 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdata.py
More file actions
50 lines (33 loc) · 1.31 KB
/
data.py
File metadata and controls
50 lines (33 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from .models import Character, Faction, Ship
__author__ = 'ekampf'
def initialize():
human = Character(name='Human')
human.put()
droid = Character(name='Droid')
droid.put()
rebels = Faction(id="rebels", name='Alliance to Restore the Republic', hero_key=human.key)
rebels.put()
empire = Faction(id="empire", name='Galactic Empire', hero_key=droid.key)
empire.put()
xwing = Ship(name='X-Wing', faction_key=rebels.key)
xwing.put()
ywing = Ship(name='Y-Wing', faction_key=rebels.key)
ywing.put()
awing = Ship(name='A-Wing', faction_key=rebels.key)
awing.put()
# Yeah, technically it's Corellian. But it flew in the service of the rebels,
# so for the purposes of this demo it's a rebel ship.
falcon = Ship(name='Millenium Falcon', faction_key=rebels.key)
falcon.put()
homeOne = Ship(name='Home One', faction_key=rebels.key)
homeOne.put()
tieFighter = Ship(name='TIE Fighter', faction_key=empire.key)
tieFighter.put()
tieInterceptor = Ship(name='TIE Interceptor', faction_key=empire.key)
tieInterceptor.put()
executor = Ship(name='Executor', faction_key=empire.key)
executor.put()
def create_ship(ship_name, faction_key):
new_ship = Ship(name=ship_name, faction_key=faction_key)
new_ship.put()
return new_ship