-
Notifications
You must be signed in to change notification settings - Fork 6
/
mappertest2.py
72 lines (53 loc) · 1.47 KB
/
mappertest2.py
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#! /usr/bin/python
def main():
from Common.config import TopHatConfig
#setup the config
kwargs = {"path":"/home/specialk/Dev/tophat/config.py"}
TopHatConfig(**kwargs)
# do the other stuff
from Model.Mapper.gamemapper import GameMapper
from Model.Mapper.usermapper import UserMapper
from Model.Mapper.killmapper import KillMapper
from Model.Mapper.playermapper import PlayerMapper
from Model.Mapper.apitokenmapper import ApitokenMapper
from Model.Mapper.objectwatcher import ObjectWatcher
# Get All the current Users from the database
UM = UserMapper()
users = UM.findAll()
for usr in users:
print usr
KM = KillMapper()
kills = KM.findAll()
for kill_ in kills:
print kill_
PM = PlayerMapper()
players = PM.findAll()
for player_ in players:
print player_
GM = GameMapper()
games = GM.findAll()
for game_ in games:
print game_
ATM = ApitokenMapper()
tokens = ATM.findAll()
for token in tokens:
print token
usr1 = UM.find(1)
#usr1.setEmail("[email protected]")
#UserMapper.update(usr1)
# Testing Identity Object
#from Mapper import identityobject
#IO = identityobject.IdentityObject(None, user.User)
#IO.field("name").eq("Kevin Baker")
#usersSelect = UserMapper.selectIdentity(IO, 0, 5)
#if usersSelect:
# for usrS in usersSelect:
# print usrS
#usr1 = UserMapper.find(1)
#usr1.setEmail("[email protected]")
#OW.printAll()
#print usr1.getEmail()
# make all changes to DB before closing it
#OW.magicSaveAll()
if __name__ == "__main__":
main()