Website to manage tibia accounts and characters
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

models.py 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. # This is an auto-generated Django model module.
  2. # You'll have to do the following manually to clean this up:
  3. # * Rearrange models' order
  4. # * Make sure each model has one field with primary_key=True
  5. # * Make sure each ForeignKey has `on_delete` set to the desired behavior.
  6. # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
  7. # Feel free to rename the models, but don't rename db_table values or field names.
  8. from django.contrib.auth.models import User
  9. from django.db import models
  10. class AccountBanHistory(models.Model):
  11. account = models.ForeignKey('Accounts', models.DO_NOTHING)
  12. reason = models.CharField(max_length=255)
  13. banned_at = models.BigIntegerField()
  14. expired_at = models.BigIntegerField()
  15. banned_by = models.ForeignKey('Players', models.DO_NOTHING, db_column='banned_by')
  16. class Meta:
  17. managed = False
  18. db_table = 'account_ban_history'
  19. class AccountBans(models.Model):
  20. account = models.OneToOneField('Accounts', models.DO_NOTHING, primary_key=True)
  21. reason = models.CharField(max_length=255)
  22. banned_at = models.BigIntegerField()
  23. expires_at = models.BigIntegerField()
  24. banned_by = models.ForeignKey('Players', models.DO_NOTHING, db_column='banned_by')
  25. class Meta:
  26. managed = False
  27. db_table = 'account_bans'
  28. class AccountViplist(models.Model):
  29. account = models.ForeignKey('Accounts', models.DO_NOTHING)
  30. player = models.ForeignKey('Players', models.DO_NOTHING)
  31. description = models.CharField(max_length=128)
  32. icon = models.PositiveIntegerField()
  33. notify = models.IntegerField()
  34. class Meta:
  35. managed = False
  36. db_table = 'account_viplist'
  37. unique_together = (('account', 'player'),)
  38. class Accounts(models.Model):
  39. name = models.CharField(unique=True, max_length=32)
  40. password = models.CharField(max_length=40)
  41. secret = models.CharField(max_length=16, blank=True, null=True)
  42. type = models.IntegerField(default=1)
  43. premdays = models.IntegerField(default=0)
  44. lastday = models.PositiveIntegerField(default=0)
  45. email = models.CharField(max_length=255)
  46. creation = models.IntegerField(default=0)
  47. linked_django_user = models.OneToOneField(User, on_delete=models.CASCADE, blank=True, null=True)
  48. class Meta:
  49. managed = True
  50. db_table = 'accounts'
  51. class GuildInvites(models.Model):
  52. player = models.ForeignKey('Players', models.DO_NOTHING, primary_key=True)
  53. guild = models.ForeignKey('Guilds', models.DO_NOTHING)
  54. class Meta:
  55. managed = False
  56. db_table = 'guild_invites'
  57. unique_together = (('player', 'guild'),)
  58. class GuildMembership(models.Model):
  59. player = models.ForeignKey('Players', models.DO_NOTHING, primary_key=True)
  60. guild = models.ForeignKey('Guilds', models.DO_NOTHING)
  61. rank = models.ForeignKey('GuildRanks', models.DO_NOTHING)
  62. nick = models.CharField(max_length=15)
  63. class Meta:
  64. managed = False
  65. db_table = 'guild_membership'
  66. class GuildRanks(models.Model):
  67. guild = models.ForeignKey('Guilds', models.DO_NOTHING)
  68. name = models.CharField(max_length=255)
  69. level = models.IntegerField()
  70. class Meta:
  71. managed = False
  72. db_table = 'guild_ranks'
  73. class GuildWars(models.Model):
  74. guild1 = models.IntegerField()
  75. guild2 = models.IntegerField()
  76. name1 = models.CharField(max_length=255)
  77. name2 = models.CharField(max_length=255)
  78. status = models.IntegerField()
  79. started = models.BigIntegerField()
  80. ended = models.BigIntegerField()
  81. class Meta:
  82. managed = False
  83. db_table = 'guild_wars'
  84. class Guilds(models.Model):
  85. name = models.CharField(unique=True, max_length=255)
  86. ownerid = models.ForeignKey('Players', models.DO_NOTHING, db_column='ownerid', unique=True)
  87. creationdata = models.IntegerField()
  88. motd = models.CharField(max_length=255)
  89. class Meta:
  90. managed = False
  91. db_table = 'guilds'
  92. class GuildwarKills(models.Model):
  93. killer = models.CharField(max_length=50)
  94. target = models.CharField(max_length=50)
  95. killerguild = models.IntegerField()
  96. targetguild = models.IntegerField()
  97. warid = models.ForeignKey(GuildWars, models.DO_NOTHING, db_column='warid')
  98. time = models.BigIntegerField()
  99. class Meta:
  100. managed = False
  101. db_table = 'guildwar_kills'
  102. class HouseLists(models.Model):
  103. house = models.ForeignKey('Houses', models.DO_NOTHING)
  104. listid = models.IntegerField()
  105. list = models.TextField()
  106. class Meta:
  107. managed = False
  108. db_table = 'house_lists'
  109. class Houses(models.Model):
  110. owner = models.IntegerField()
  111. paid = models.PositiveIntegerField()
  112. warnings = models.IntegerField()
  113. name = models.CharField(max_length=255)
  114. rent = models.IntegerField()
  115. town_id = models.IntegerField()
  116. bid = models.IntegerField()
  117. bid_end = models.IntegerField()
  118. last_bid = models.IntegerField()
  119. highest_bidder = models.IntegerField()
  120. size = models.IntegerField()
  121. beds = models.IntegerField()
  122. class Meta:
  123. managed = False
  124. db_table = 'houses'
  125. class IpBans(models.Model):
  126. ip = models.PositiveIntegerField(primary_key=True)
  127. reason = models.CharField(max_length=255)
  128. banned_at = models.BigIntegerField()
  129. expires_at = models.BigIntegerField()
  130. banned_by = models.ForeignKey('Players', models.DO_NOTHING, db_column='banned_by')
  131. class Meta:
  132. managed = False
  133. db_table = 'ip_bans'
  134. class MarketHistory(models.Model):
  135. player = models.ForeignKey('Players', models.DO_NOTHING)
  136. sale = models.IntegerField()
  137. itemtype = models.PositiveIntegerField()
  138. amount = models.PositiveSmallIntegerField()
  139. price = models.PositiveIntegerField()
  140. expires_at = models.BigIntegerField()
  141. inserted = models.BigIntegerField()
  142. state = models.PositiveIntegerField()
  143. class Meta:
  144. managed = False
  145. db_table = 'market_history'
  146. class MarketOffers(models.Model):
  147. player = models.ForeignKey('Players', models.DO_NOTHING)
  148. sale = models.IntegerField()
  149. itemtype = models.PositiveIntegerField()
  150. amount = models.PositiveSmallIntegerField()
  151. created = models.BigIntegerField()
  152. anonymous = models.IntegerField()
  153. price = models.PositiveIntegerField()
  154. class Meta:
  155. managed = False
  156. db_table = 'market_offers'
  157. class PlayerDeaths(models.Model):
  158. player = models.ForeignKey('Players', models.DO_NOTHING)
  159. time = models.BigIntegerField()
  160. level = models.IntegerField()
  161. killed_by = models.CharField(max_length=255)
  162. is_player = models.IntegerField()
  163. mostdamage_by = models.CharField(max_length=100)
  164. mostdamage_is_player = models.IntegerField()
  165. unjustified = models.IntegerField()
  166. mostdamage_unjustified = models.IntegerField()
  167. class Meta:
  168. managed = False
  169. db_table = 'player_deaths'
  170. class PlayerDepotitems(models.Model):
  171. player = models.ForeignKey('Players', models.DO_NOTHING)
  172. sid = models.IntegerField()
  173. pid = models.IntegerField()
  174. itemtype = models.SmallIntegerField()
  175. count = models.SmallIntegerField()
  176. attributes = models.TextField()
  177. class Meta:
  178. managed = False
  179. db_table = 'player_depotitems'
  180. unique_together = (('player', 'sid'),)
  181. class PlayerInboxitems(models.Model):
  182. player = models.ForeignKey('Players', models.DO_NOTHING)
  183. sid = models.IntegerField()
  184. pid = models.IntegerField()
  185. itemtype = models.SmallIntegerField()
  186. count = models.SmallIntegerField()
  187. attributes = models.TextField()
  188. class Meta:
  189. managed = False
  190. db_table = 'player_inboxitems'
  191. unique_together = (('player', 'sid'),)
  192. class PlayerItems(models.Model):
  193. player = models.ForeignKey('Players', models.DO_NOTHING)
  194. pid = models.IntegerField()
  195. sid = models.IntegerField()
  196. itemtype = models.SmallIntegerField()
  197. count = models.SmallIntegerField()
  198. attributes = models.TextField()
  199. class Meta:
  200. managed = False
  201. db_table = 'player_items'
  202. class PlayerNamelocks(models.Model):
  203. player = models.ForeignKey('Players', models.DO_NOTHING, primary_key=True)
  204. reason = models.CharField(max_length=255)
  205. namelocked_at = models.BigIntegerField()
  206. namelocked_by = models.ForeignKey('Players', models.DO_NOTHING, db_column='namelocked_by', related_name='namelocks')
  207. class Meta:
  208. managed = False
  209. db_table = 'player_namelocks'
  210. class PlayerSpells(models.Model):
  211. player = models.ForeignKey('Players', models.DO_NOTHING)
  212. name = models.CharField(max_length=255)
  213. class Meta:
  214. managed = False
  215. db_table = 'player_spells'
  216. class PlayerStorage(models.Model):
  217. player = models.ForeignKey('Players', models.DO_NOTHING, primary_key=True)
  218. key = models.PositiveIntegerField()
  219. value = models.IntegerField()
  220. class Meta:
  221. managed = False
  222. db_table = 'player_storage'
  223. unique_together = (('player', 'key'),)
  224. class Players(models.Model):
  225. name = models.CharField(unique=True, max_length=255)
  226. group_id = models.IntegerField()
  227. account = models.ForeignKey(Accounts, models.DO_NOTHING)
  228. level = models.IntegerField()
  229. vocation = models.IntegerField()
  230. health = models.IntegerField()
  231. healthmax = models.IntegerField()
  232. experience = models.BigIntegerField()
  233. lookbody = models.IntegerField()
  234. lookfeet = models.IntegerField()
  235. lookhead = models.IntegerField()
  236. looklegs = models.IntegerField()
  237. looktype = models.IntegerField()
  238. lookaddons = models.IntegerField()
  239. maglevel = models.IntegerField()
  240. mana = models.IntegerField()
  241. manamax = models.IntegerField()
  242. manaspent = models.PositiveIntegerField()
  243. soul = models.PositiveIntegerField()
  244. town_id = models.IntegerField()
  245. posx = models.IntegerField()
  246. posy = models.IntegerField()
  247. posz = models.IntegerField()
  248. conditions = models.TextField()
  249. cap = models.IntegerField()
  250. sex = models.IntegerField()
  251. lastlogin = models.BigIntegerField()
  252. lastip = models.PositiveIntegerField()
  253. save = models.IntegerField()
  254. skull = models.IntegerField()
  255. skulltime = models.IntegerField()
  256. lastlogout = models.BigIntegerField()
  257. blessings = models.IntegerField()
  258. onlinetime = models.IntegerField()
  259. deletion = models.BigIntegerField()
  260. balance = models.BigIntegerField()
  261. offlinetraining_time = models.PositiveSmallIntegerField()
  262. offlinetraining_skill = models.IntegerField()
  263. stamina = models.PositiveSmallIntegerField()
  264. skill_fist = models.PositiveIntegerField()
  265. skill_fist_tries = models.BigIntegerField()
  266. skill_club = models.PositiveIntegerField()
  267. skill_club_tries = models.BigIntegerField()
  268. skill_sword = models.PositiveIntegerField()
  269. skill_sword_tries = models.BigIntegerField()
  270. skill_axe = models.PositiveIntegerField()
  271. skill_axe_tries = models.BigIntegerField()
  272. skill_dist = models.PositiveIntegerField()
  273. skill_dist_tries = models.BigIntegerField()
  274. skill_shielding = models.PositiveIntegerField()
  275. skill_shielding_tries = models.BigIntegerField()
  276. skill_fishing = models.PositiveIntegerField()
  277. skill_fishing_tries = models.BigIntegerField()
  278. class Meta:
  279. managed = False
  280. db_table = 'players'
  281. class PlayersOnline(models.Model):
  282. player_id = models.IntegerField(primary_key=True)
  283. class Meta:
  284. managed = False
  285. db_table = 'players_online'
  286. class ServerConfig(models.Model):
  287. config = models.CharField(primary_key=True, max_length=50)
  288. value = models.CharField(max_length=256)
  289. class Meta:
  290. managed = False
  291. db_table = 'server_config'
  292. class TileStore(models.Model):
  293. house = models.ForeignKey(Houses, models.DO_NOTHING)
  294. data = models.TextField()
  295. class Meta:
  296. managed = False
  297. db_table = 'tile_store'
  298. class Towns(models.Model):
  299. name = models.CharField(unique=True, max_length=255)
  300. posx = models.IntegerField()
  301. posy = models.IntegerField()
  302. posz = models.IntegerField()
  303. class Meta:
  304. managed = False
  305. db_table = 'towns'