pokeapi/pokemon_v2/models.py

1431 lines
29 KiB
Python
Raw Normal View History

2014-12-04 11:11:46 +00:00
from __future__ import unicode_literals
from django.db import models
#####################
# ABSTRACT MODELS #
#####################
2016-03-05 09:27:25 +00:00
2015-04-07 12:14:31 +00:00
class HasAbility(models.Model):
2016-03-05 09:27:25 +00:00
ability = models.ForeignKey('Ability', blank=True, null=True, related_name="%(class)s")
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
2015-04-07 12:14:31 +00:00
2015-04-07 12:14:31 +00:00
class HasCharacteristic(models.Model):
2016-03-05 09:27:25 +00:00
characteristic = models.ForeignKey(
'Characteristic', blank=True, null=True, related_name="%(class)s")
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
2015-04-07 12:14:31 +00:00
class HasContestType(models.Model):
2016-03-05 09:27:25 +00:00
contest_type = models.ForeignKey(
'ContestType', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasContestEffect(models.Model):
2016-03-05 09:27:25 +00:00
contest_effect = models.ForeignKey(
'ContestEffect', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasSuperContestEffect(models.Model):
2016-03-05 09:27:25 +00:00
super_contest_effect = models.ForeignKey(
'SuperContestEffect', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasDescription(models.Model):
2016-03-05 09:27:25 +00:00
description = models.CharField(max_length=1000, default='')
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasGender(models.Model):
2016-03-05 09:27:25 +00:00
gender = models.ForeignKey(
'Gender', blank=True, null=True, related_name="%(class)s")
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
2015-04-07 12:14:31 +00:00
class HasEffect(models.Model):
2016-03-05 09:27:25 +00:00
effect = models.CharField(max_length=6000)
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
2015-04-07 12:14:31 +00:00
class HasEggGroup(models.Model):
2016-03-05 09:27:25 +00:00
egg_group = models.ForeignKey(
'EggGroup', blank=True, null=True, related_name="%(class)s")
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
2015-04-07 12:14:31 +00:00
class HasEncounterMethod(models.Model):
2016-03-05 09:27:25 +00:00
encounter_method = models.ForeignKey(
'EncounterMethod', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasEncounterCondition(models.Model):
2016-03-05 09:27:25 +00:00
encounter_condition = models.ForeignKey(
'EncounterCondition', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasEvolutionTrigger(models.Model):
2016-03-05 09:27:25 +00:00
evolution_trigger = models.ForeignKey(
'EvolutionTrigger', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasFlavorText(models.Model):
2016-03-05 09:27:25 +00:00
flavor_text = models.CharField(max_length=500)
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasFlingEffect(models.Model):
2016-03-05 09:27:25 +00:00
item_fling_effect = models.ForeignKey(
'ItemFlingEffect', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasGameIndex(models.Model):
2016-03-05 09:27:25 +00:00
game_index = models.IntegerField()
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
2015-04-07 12:14:31 +00:00
class HasGeneration(models.Model):
2016-03-05 09:27:25 +00:00
generation = models.ForeignKey('Generation', blank=True, null=True, related_name="%(class)s")
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
2015-04-07 12:14:31 +00:00
2015-04-07 12:14:31 +00:00
class HasGrowthRate(models.Model):
2016-03-05 09:27:25 +00:00
growth_rate = models.ForeignKey('GrowthRate', blank=True, null=True, related_name="%(class)s")
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
2015-04-07 12:14:31 +00:00
class HasItem(models.Model):
2016-03-05 09:27:25 +00:00
item = models.ForeignKey('Item', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasItemAttribute(models.Model):
2016-03-05 09:27:25 +00:00
item_attribute = models.ForeignKey(
'ItemAttribute', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasItemCategory(models.Model):
2016-03-05 09:27:25 +00:00
item_category = models.ForeignKey(
'ItemCategory', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasItemPocket(models.Model):
2016-03-05 09:27:25 +00:00
item_pocket = models.ForeignKey(
'ItemPocket', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasLanguage(models.Model):
2016-03-05 09:27:25 +00:00
language = models.ForeignKey(
'Language', blank=True, null=True, related_name="%(class)s_language")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasLocation(models.Model):
2016-03-05 09:27:25 +00:00
location = models.ForeignKey('Location', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasLocationArea(models.Model):
2016-03-05 09:27:25 +00:00
location_area = models.ForeignKey(
'LocationArea', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasMetaAilment(models.Model):
2016-03-05 09:27:25 +00:00
move_meta_ailment = models.ForeignKey(
'MoveMetaAilment', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasMetaCategory(models.Model):
2016-03-05 09:27:25 +00:00
move_meta_category = models.ForeignKey(
'MoveMetaCategory', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasMove(models.Model):
2016-03-05 09:27:25 +00:00
move = models.ForeignKey('Move', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasMoveDamageClass(models.Model):
2016-03-05 09:27:25 +00:00
move_damage_class = models.ForeignKey(
'MoveDamageClass', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasMoveEffect(models.Model):
2016-03-05 09:27:25 +00:00
move_effect = models.ForeignKey('MoveEffect', blank=True, null=True)
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasMoveAttribute(models.Model):
2016-03-05 09:27:25 +00:00
move_attribute = models.ForeignKey('MoveAttribute', blank=True, null=True)
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasMoveTarget(models.Model):
2016-03-05 09:27:25 +00:00
move_target = models.ForeignKey(
'MoveTarget', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasName(models.Model):
name = models.CharField(max_length=100, db_index=True)
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
2015-04-07 12:14:31 +00:00
class HasNature(models.Model):
2016-03-05 09:27:25 +00:00
nature = models.ForeignKey('Nature', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasOrder(models.Model):
2016-03-05 09:27:25 +00:00
order = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasPokeathlonStat(models.Model):
2016-03-05 09:27:25 +00:00
pokeathlon_stat = models.ForeignKey(
'PokeathlonStat', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasPokedex(models.Model):
2016-03-05 09:27:25 +00:00
pokedex = models.ForeignKey('Pokedex', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasPokemon(models.Model):
2016-03-05 09:27:25 +00:00
pokemon = models.ForeignKey('Pokemon', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasPokemonColor(models.Model):
2016-03-05 09:27:25 +00:00
pokemon_color = models.ForeignKey(
'PokemonColor', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasPokemonForm(models.Model):
2016-03-05 09:27:25 +00:00
pokemon_form = models.ForeignKey(
'PokemonForm', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasPokemonHabitat(models.Model):
2016-03-05 09:27:25 +00:00
pokemon_habitat = models.ForeignKey(
'PokemonHabitat', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
2016-03-05 09:27:25 +00:00
# HasPokemonMoveMethod
class HasMoveLearnMethod(models.Model):
2016-03-05 09:27:25 +00:00
move_learn_method = models.ForeignKey(
'MoveLearnMethod', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasPokemonShape(models.Model):
2016-03-05 09:27:25 +00:00
pokemon_shape = models.ForeignKey(
'PokemonShape', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasPokemonSpecies(models.Model):
2016-03-05 09:27:25 +00:00
pokemon_species = models.ForeignKey(
'PokemonSpecies', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasRegion(models.Model):
2016-03-05 09:27:25 +00:00
region = models.ForeignKey('Region', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasShortEffect(models.Model):
2016-03-05 09:27:25 +00:00
short_effect = models.CharField(max_length=300)
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasStat(models.Model):
2016-03-05 09:27:25 +00:00
stat = models.ForeignKey('Stat', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasType(models.Model):
2016-03-05 09:27:25 +00:00
type = models.ForeignKey('Type', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasVersion(models.Model):
2016-03-05 09:27:25 +00:00
version = models.ForeignKey('Version', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class HasVersionGroup(models.Model):
2016-03-05 09:27:25 +00:00
version_group = models.ForeignKey(
'VersionGroup', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class IsDescription(HasLanguage, HasDescription):
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class IsName(HasLanguage, HasName):
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
class IsFlavorText(HasLanguage, HasFlavorText):
2016-03-05 09:27:25 +00:00
class Meta:
abstract = True
####################
# VERSION MODELS #
####################
class Version(HasName, HasVersionGroup):
2016-03-05 09:27:25 +00:00
pass
2015-10-18 23:01:33 +00:00
class VersionName(IsName, HasVersion):
2016-03-05 09:27:25 +00:00
pass
class VersionGroup(HasName, HasGeneration, HasOrder):
2016-03-05 09:27:25 +00:00
pass
class VersionGroupRegion(HasVersionGroup, HasRegion):
2016-03-05 09:27:25 +00:00
pass
2016-03-05 09:27:25 +00:00
# VersionGroupPokemonMoveMethod
class VersionGroupMoveLearnMethod(HasVersionGroup, HasMoveLearnMethod):
pass
#####################
# LANGUAGE MODELS #
#####################
class Language(HasName, HasOrder):
2016-03-05 09:27:25 +00:00
iso639 = models.CharField(max_length=2)
2016-03-05 09:27:25 +00:00
iso3166 = models.CharField(max_length=2)
2016-03-05 09:27:25 +00:00
official = models.BooleanField(default=False)
class LanguageName(IsName):
2016-03-05 09:27:25 +00:00
local_language = models.ForeignKey(
'Language', blank=True, null=True, related_name="locallanguage")
#######################
# GENERATION MODELS #
#######################
class Generation(HasName):
2016-03-05 09:27:25 +00:00
region = models.OneToOneField('Region', blank=True, null=True, related_name="%(class)s")
class GenerationName(IsName, HasGeneration):
2016-03-05 09:27:25 +00:00
pass
###################
# REGION MODELS #
###################
class Region(HasName):
2016-03-05 09:27:25 +00:00
pass
class RegionName(IsName, HasRegion):
2016-03-05 09:27:25 +00:00
pass
####################
# ABILITY MODELS #
####################
class Ability(HasName, HasGeneration):
2016-03-05 09:27:25 +00:00
is_main_series = models.BooleanField(default=False)
class AbilityEffectText(HasLanguage, HasEffect, HasShortEffect, HasAbility):
2016-03-05 09:27:25 +00:00
pass
class AbilityFlavorText(IsFlavorText, HasAbility, HasVersionGroup):
2016-03-05 09:27:25 +00:00
pass
class AbilityName(IsName, HasAbility):
2016-03-05 09:27:25 +00:00
pass
class AbilityChange(HasAbility, HasVersionGroup):
2016-03-05 09:27:25 +00:00
pass
class AbilityChangeEffectText(HasLanguage, HasEffect):
2016-03-05 09:27:25 +00:00
ability_change = models.ForeignKey(
AbilityChange, blank=True, null=True, related_name="%(class)s")
#################
# TYPE MODELS #
#################
class Type(HasName, HasGeneration, HasMoveDamageClass):
2016-03-05 09:27:25 +00:00
pass
class TypeName(IsName, HasType):
2016-03-05 09:27:25 +00:00
pass
class TypeGameIndex(HasType, HasGeneration, HasGameIndex):
2016-03-05 09:27:25 +00:00
pass
class TypeEfficacy(models.Model):
2016-03-05 09:27:25 +00:00
damage_type = models.ForeignKey('Type', blank=True, null=True, related_name="damage_type")
2016-03-05 09:27:25 +00:00
target_type = models.ForeignKey('Type', blank=True, null=True, related_name="target_type")
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
damage_factor = models.IntegerField()
2015-04-07 12:14:31 +00:00
#################
# STAT MODELS #
#################
class Stat(HasName, HasMoveDamageClass):
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
is_battle_only = models.BooleanField(default=False)
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
game_index = models.IntegerField()
2015-04-07 12:14:31 +00:00
class StatName(IsName, HasStat):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
###########################
# CHARACTERISTIC MODELS #
###########################
class Characteristic(HasStat):
2016-03-05 09:27:25 +00:00
gene_mod_5 = models.IntegerField()
2015-04-07 12:14:31 +00:00
class CharacteristicDescription(HasCharacteristic, IsDescription):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
######################
# EGG GROUP MODELS #
######################
class EggGroup(HasName):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
class EggGroupName(IsName, HasEggGroup):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
#################
# ITEM MODELS #
#################
2015-04-07 12:14:31 +00:00
class ItemPocket(HasName):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
class ItemPocketName(IsName, HasItemPocket):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
class ItemCategory(HasName, HasItemPocket):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
class ItemCategoryName(IsName, HasItemCategory):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
class ItemFlingEffect(HasName):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
class ItemFlingEffectEffectText(HasLanguage, HasEffect, HasFlingEffect):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
class Item(HasName, HasItemCategory, HasFlingEffect):
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
cost = models.IntegerField(blank=True, null=True)
2015-04-07 12:14:31 +00:00
2016-03-05 09:27:25 +00:00
fling_power = models.IntegerField(blank=True, null=True)
2015-04-07 12:14:31 +00:00
class ItemEffectText(HasItem, HasLanguage, HasEffect, HasShortEffect):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
class ItemName(HasItem, IsName):
2016-03-05 09:27:25 +00:00
pass
2015-04-07 12:14:31 +00:00
class ItemFlavorText(HasItem, HasVersionGroup, IsFlavorText):
2016-03-05 09:27:25 +00:00
pass
2015-10-23 04:56:01 +00:00
class ItemAttribute(HasName):
2016-03-05 09:27:25 +00:00
pass
class ItemAttributeName(IsName, HasItemAttribute):
2016-03-05 09:27:25 +00:00
pass
class ItemAttributeDescription(IsDescription, HasItemAttribute):
2016-03-05 09:27:25 +00:00
pass
class ItemAttributeMap(HasItem, HasItemAttribute):
2016-03-05 09:27:25 +00:00
pass
class ItemGameIndex(HasItem, HasGeneration, HasGameIndex):
2016-03-05 09:27:25 +00:00
pass
class ItemSprites(HasItem):
2016-03-05 09:27:25 +00:00
sprites = models.CharField(max_length=500)
####################
# CONTEST MODELS #
####################
class ContestType(HasName):
2016-03-05 09:27:25 +00:00
pass
class ContestTypeName(HasContestType, IsName):
2016-03-05 09:27:25 +00:00
flavor = models.CharField(max_length=10)
2016-03-05 09:27:25 +00:00
color = models.CharField(max_length=10)
class ContestEffect(models.Model):
2016-03-05 09:27:25 +00:00
appeal = models.IntegerField()
2016-03-05 09:27:25 +00:00
jam = models.IntegerField()
class ContestEffectEffectText(HasLanguage, HasEffect, HasContestEffect):
2016-03-05 09:27:25 +00:00
pass
class ContestEffectFlavorText(HasLanguage, HasFlavorText, HasContestEffect):
2016-03-05 09:27:25 +00:00
pass
class ContestCombo(models.Model):
first_move = models.ForeignKey('Move', blank=True, null=True, related_name='first_move')
second_move = models.ForeignKey('Move', blank=True, null=True, related_name='second_move')
##################
# BERRY MODELS #
##################
class BerryFirmness(HasName):
2016-03-05 09:27:25 +00:00
pass
class BerryFirmnessName(IsName):
2016-03-05 09:27:25 +00:00
berry_firmness = models.ForeignKey(
BerryFirmness, blank=True, null=True, related_name="%(class)s")
class Berry(HasName, HasItem):
2016-03-05 09:27:25 +00:00
berry_firmness = models.ForeignKey(
BerryFirmness, blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
natural_gift_power = models.IntegerField()
2016-03-05 09:27:25 +00:00
natural_gift_type = models.ForeignKey(Type, blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
size = models.IntegerField()
2016-03-05 09:27:25 +00:00
max_harvest = models.IntegerField()
2016-03-05 09:27:25 +00:00
growth_time = models.IntegerField()
2016-03-05 09:27:25 +00:00
soil_dryness = models.IntegerField()
2016-03-05 09:27:25 +00:00
smoothness = models.IntegerField()
2015-11-10 19:20:06 +00:00
"""
Berry Flavors are a bit of a hack because their relationship
in terms of flavors to contest types is really awkward the
2016-03-05 09:27:25 +00:00
way it was handled in the veekun data set. Berry Flavor here
does not match the csv table. Berry Flavor Map
2015-11-10 19:20:06 +00:00
is a table fabricated just to suit this project.
"""
2016-03-05 09:27:25 +00:00
class BerryFlavor(HasName):
2016-03-05 09:27:25 +00:00
contest_type = models.OneToOneField(
'ContestType', blank=True, null=True, related_name="%(class)s")
2015-11-10 19:20:06 +00:00
class BerryFlavorName(IsName):
2016-03-05 09:27:25 +00:00
berry_flavor = models.ForeignKey(BerryFlavor, blank=True, null=True, related_name="%(class)s")
2015-11-10 19:20:06 +00:00
class BerryFlavorMap(models.Model):
2016-03-05 09:27:25 +00:00
berry = models.ForeignKey(Berry, blank=True, null=True, related_name="%(class)s")
2015-11-10 19:20:06 +00:00
2016-03-05 09:27:25 +00:00
berry_flavor = models.ForeignKey(BerryFlavor, blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
potency = models.IntegerField()
########################
# GROWTH RATE MODELS #
########################
class GrowthRate(HasName):
2016-03-05 09:27:25 +00:00
formula = models.CharField(max_length=500)
class GrowthRateDescription(HasGrowthRate, IsDescription):
2016-03-05 09:27:25 +00:00
pass
###################
# NATURE MODELS #
###################
class Nature(HasName):
2016-03-05 09:27:25 +00:00
decreased_stat = models.ForeignKey(Stat, blank=True, null=True, related_name='decreased')
2016-03-05 09:27:25 +00:00
increased_stat = models.ForeignKey(Stat, blank=True, null=True, related_name='increased')
2016-03-05 09:27:25 +00:00
hates_flavor = models.ForeignKey(
BerryFlavor, blank=True, null=True, related_name='hates_flavor')
2016-03-05 09:27:25 +00:00
likes_flavor = models.ForeignKey(
BerryFlavor, blank=True, null=True, related_name='likes_flavor')
2016-03-05 09:27:25 +00:00
game_index = models.IntegerField()
class NatureName(IsName, HasNature):
2016-03-05 09:27:25 +00:00
pass
class NaturePokeathlonStat(HasNature, HasPokeathlonStat):
2016-03-05 09:27:25 +00:00
max_change = models.IntegerField()
class NatureBattleStylePreference(HasNature):
2016-03-05 09:27:25 +00:00
move_battle_style = models.ForeignKey(
'MoveBattleStyle', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
low_hp_preference = models.IntegerField()
2016-03-05 09:27:25 +00:00
high_hp_preference = models.IntegerField()
#####################
# LOCATION MODELS #
#####################
class Location(HasRegion, HasName):
2016-03-05 09:27:25 +00:00
pass
class LocationName(HasLocation, IsName):
2016-03-05 09:27:25 +00:00
pass
class LocationGameIndex(HasLocation, HasGeneration, HasGameIndex):
2016-03-05 09:27:25 +00:00
pass
class LocationArea(HasLocation, HasGameIndex, HasName):
2016-03-05 09:27:25 +00:00
pass
class LocationAreaName(IsName, HasLocationArea):
2016-03-05 09:27:25 +00:00
pass
class LocationAreaEncounterRate(HasEncounterMethod, HasLocationArea, HasVersion):
2016-03-05 09:27:25 +00:00
rate = models.IntegerField()
######################
# ENCOUNTER MODELS #
######################
class EncounterMethod(HasName, HasOrder):
2016-03-05 09:27:25 +00:00
pass
class EncounterMethodName(HasEncounterMethod, IsName):
2016-03-05 09:27:25 +00:00
pass
class EncounterSlot(HasVersionGroup, HasEncounterMethod):
2016-03-05 09:27:25 +00:00
slot = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
rarity = models.IntegerField()
class Encounter(HasVersion, HasLocationArea, HasPokemon):
2016-03-05 09:27:25 +00:00
encounter_slot = models.ForeignKey(EncounterSlot, blank=True, null=True)
2016-03-05 09:27:25 +00:00
min_level = models.IntegerField()
2016-03-05 09:27:25 +00:00
max_level = models.IntegerField()
class EncounterCondition(HasName):
2016-03-05 09:27:25 +00:00
pass
class EncounterConditionName(HasEncounterCondition, IsName):
2016-03-05 09:27:25 +00:00
pass
class EncounterConditionValue(HasEncounterCondition, HasName):
2016-03-05 09:27:25 +00:00
is_default = models.BooleanField(default=False)
class EncounterConditionValueName(IsName):
2016-03-05 09:27:25 +00:00
encounter_condition_value = models.ForeignKey(
EncounterConditionValue, blank=True, null=True, related_name="%(class)s")
class EncounterConditionValueMap(models.Model):
2016-03-05 09:27:25 +00:00
encounter = models.ForeignKey(Encounter, blank=True, null=True)
2016-03-05 09:27:25 +00:00
encounter_condition_value = models.ForeignKey(EncounterConditionValue, blank=True, null=True)
#################
# MOVE MODELS #
#################
2016-03-05 09:27:25 +00:00
class Move(
HasName, HasGeneration, HasType, HasMoveDamageClass, HasMoveEffect,
HasMoveTarget, HasContestType, HasContestEffect, HasSuperContestEffect):
2016-03-05 09:27:25 +00:00
power = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
pp = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
accuracy = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
priority = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
move_effect_chance = models.IntegerField(blank=True, null=True)
class MoveName(HasMove, IsName):
2016-03-05 09:27:25 +00:00
pass
class MoveFlavorText(HasMove, HasVersionGroup, IsFlavorText):
2016-03-05 09:27:25 +00:00
pass
class MoveChange(HasMove, HasVersionGroup, HasType, HasMoveEffect):
2016-03-05 09:27:25 +00:00
power = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
pp = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
accuracy = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
move_effect_chance = models.IntegerField(blank=True, null=True)
##############################
# MOVE DAMAGE CLASS MODELS #
##############################
class MoveDamageClass(HasName):
2016-03-05 09:27:25 +00:00
pass
class MoveDamageClassName(HasMoveDamageClass, IsName):
2016-03-05 09:27:25 +00:00
pass
2016-03-05 09:27:25 +00:00
class MoveDamageClassDescription(HasMoveDamageClass, IsDescription):
pass
##############################
# MOVE BATTLE STYLE MODELS #
##############################
class MoveBattleStyle(HasName):
2016-03-05 09:27:25 +00:00
pass
class MoveBattleStyleName(IsName):
2016-03-05 09:27:25 +00:00
move_battle_style = models.ForeignKey(
MoveBattleStyle, blank=True, null=True, related_name="%(class)s")
########################
# MOVE EFFECT MODELS #
########################
class MoveEffect(models.Model):
2016-03-05 09:27:25 +00:00
pass
class MoveEffectEffectText(HasLanguage, HasMoveEffect, HasEffect, HasShortEffect):
2016-03-05 09:27:25 +00:00
pass
class MoveEffectChange(HasMoveEffect, HasVersionGroup):
2016-03-05 09:27:25 +00:00
pass
class MoveEffectChangeEffectText(HasLanguage, HasEffect):
2016-03-05 09:27:25 +00:00
move_effect_change = models.ForeignKey(
'MoveEffectChange', blank=True, null=True, related_name="%(class)s")
################################
# MOVE FLAG/ATTRIBUTE MODELS #
################################
class MoveAttribute(HasName):
2016-03-05 09:27:25 +00:00
pass
class MoveAttributeName(HasMoveAttribute, IsName):
2016-03-05 09:27:25 +00:00
pass
class MoveAttributeDescription(HasMoveAttribute, IsDescription):
2016-03-05 09:27:25 +00:00
pass
class MoveAttributeMap(HasMove, HasMoveAttribute):
2016-03-05 09:27:25 +00:00
pass
########################
# MOVE TARGET MODELS #
########################
class MoveTarget(HasName):
2016-03-05 09:27:25 +00:00
pass
class MoveTargetName(HasMoveTarget, IsName):
2016-03-05 09:27:25 +00:00
pass
class MoveTargetDescription(HasMoveTarget, IsDescription):
2016-03-05 09:27:25 +00:00
pass
######################
# MOVE META MODELS #
######################
class MoveMeta(HasMetaAilment, HasMetaCategory):
2016-03-05 09:27:25 +00:00
move = models.OneToOneField(Move, blank=False, null=False, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
min_hits = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
max_hits = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
min_turns = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
max_turns = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
drain = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
healing = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
crit_rate = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
ailment_chance = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
flinch_chance = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
stat_chance = models.IntegerField(blank=True, null=True)
class MoveMetaAilment(HasName):
2016-03-05 09:27:25 +00:00
pass
class MoveMetaAilmentName(HasMetaAilment, IsName):
2016-03-05 09:27:25 +00:00
pass
class MoveMetaCategory(HasName):
2016-03-05 09:27:25 +00:00
pass
class MoveMetaCategoryDescription(HasMetaCategory, IsDescription):
2016-03-05 09:27:25 +00:00
pass
class MoveMetaStatChange(HasMove, HasStat):
2016-03-05 09:27:25 +00:00
change = models.IntegerField()
#######################
# EXPERIENCE MODELS #
#######################
class Experience(HasGrowthRate):
2016-03-05 09:27:25 +00:00
level = models.IntegerField()
2016-03-05 09:27:25 +00:00
experience = models.IntegerField()
###################
# GENDER MODELS #
###################
class Gender(HasName):
2016-03-05 09:27:25 +00:00
pass
####################
# MACHINE MODELS #
####################
class Machine(HasGrowthRate, HasItem):
2016-03-05 09:27:25 +00:00
machine_number = models.IntegerField()
2016-03-05 09:27:25 +00:00
version_group = models.ForeignKey(VersionGroup, blank=True, null=True)
2016-03-05 09:27:25 +00:00
move = models.ForeignKey(Move, blank=True, null=True)
#######################
# POKEATHLON MODELS #
#######################
class PokeathlonStat(HasName):
2016-03-05 09:27:25 +00:00
pass
class PokeathlonStatName(IsName, HasPokeathlonStat):
2016-03-05 09:27:25 +00:00
pass
#####################
# PAL PARK MODELS #
#####################
class PalParkArea(HasName):
2016-03-05 09:27:25 +00:00
pass
class PalParkAreaName(IsName):
2016-03-05 09:27:25 +00:00
pal_park_area = models.ForeignKey(
PalParkArea, blank=True, null=True, related_name="%(class)s")
class PalPark(HasPokemonSpecies):
2016-03-05 09:27:25 +00:00
pal_park_area = models.ForeignKey(
PalParkArea, blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
base_score = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
rate = models.IntegerField()
##########################
# SUPER CONTEST MODELS #
##########################
class SuperContestEffect(models.Model):
2016-03-05 09:27:25 +00:00
appeal = models.IntegerField()
class SuperContestEffectFlavorText(IsFlavorText, HasSuperContestEffect):
2016-03-05 09:27:25 +00:00
pass
class SuperContestCombo(models.Model):
2016-03-05 09:27:25 +00:00
first_move = models.ForeignKey(Move, blank=True, null=True, related_name='first')
2016-03-05 09:27:25 +00:00
second_move = models.ForeignKey(Move, blank=True, null=True, related_name='second')
######################
# EVOLUTION MODELS #
######################
class EvolutionChain(models.Model):
2016-03-05 09:27:25 +00:00
baby_trigger_item = models.ForeignKey(Item, blank=True, null=True)
class EvolutionTrigger(HasName):
2016-03-05 09:27:25 +00:00
pass
class EvolutionTriggerName(HasEvolutionTrigger, IsName):
2016-03-05 09:27:25 +00:00
pass
####################
# POKEDEX MODELS #
####################
class Pokedex(HasName, HasRegion):
2016-03-05 09:27:25 +00:00
is_main_series = models.BooleanField(default=False)
class PokedexName(HasPokedex, IsName):
2016-03-05 09:27:25 +00:00
pass
class PokedexDescription(HasPokedex, IsDescription):
2016-03-05 09:27:25 +00:00
pass
class PokedexVersionGroup(HasPokedex, HasVersionGroup):
2016-03-05 09:27:25 +00:00
pass
####################
# POKEMON MODELS #
####################
class PokemonSpecies(HasName, HasGeneration, HasPokemonColor,
HasPokemonShape, HasGrowthRate, HasOrder):
2016-03-05 09:27:25 +00:00
evolves_from_species = models.ForeignKey('self', blank=True, null=True)
2016-03-05 09:27:25 +00:00
evolution_chain = models.ForeignKey(EvolutionChain, blank=True, null=True)
2016-03-05 09:27:25 +00:00
pokemon_habitat = models.ForeignKey(
'PokemonHabitat', blank=True, null=True, related_name="%(class)s")
2016-03-05 09:27:25 +00:00
gender_rate = models.IntegerField()
2016-03-05 09:27:25 +00:00
capture_rate = models.IntegerField()
2016-03-05 09:27:25 +00:00
base_happiness = models.IntegerField()
2016-03-05 09:27:25 +00:00
is_baby = models.BooleanField(default=False)
2016-03-05 09:27:25 +00:00
hatch_counter = models.IntegerField()
2016-03-05 09:27:25 +00:00
has_gender_differences = models.BooleanField(default=False)
2016-03-05 09:27:25 +00:00
forms_switchable = models.BooleanField(default=False)
class PokemonSpeciesName(IsName, HasPokemonSpecies):
2016-03-05 09:27:25 +00:00
genus = models.CharField(max_length=30)
class PokemonSpeciesDescription(HasPokemonSpecies, IsDescription):
2016-03-05 09:27:25 +00:00
pass
class PokemonSpeciesFlavorText(IsFlavorText, HasPokemonSpecies, HasVersion):
2016-03-05 09:27:25 +00:00
pass
class Pokemon(HasName, HasPokemonSpecies, HasOrder):
2016-03-05 09:27:25 +00:00
height = models.IntegerField()
2016-03-05 09:27:25 +00:00
weight = models.IntegerField()
2016-03-05 09:27:25 +00:00
base_experience = models.IntegerField()
2016-03-05 09:27:25 +00:00
is_default = models.BooleanField(default=False)
class PokemonAbility(HasPokemon, HasAbility):
2016-03-05 09:27:25 +00:00
is_hidden = models.BooleanField(default=False)
2016-03-05 09:27:25 +00:00
slot = models.IntegerField()
class PokemonColor(HasName):
2016-03-05 09:27:25 +00:00
pass
class PokemonColorName(HasPokemonColor, IsName):
2016-03-05 09:27:25 +00:00
pass
class PokemonDexNumber(HasPokemonSpecies, HasPokedex):
2016-03-05 09:27:25 +00:00
pokedex_number = models.IntegerField()
class PokemonEggGroup(HasPokemonSpecies, HasEggGroup):
2016-03-05 09:27:25 +00:00
pass
class PokemonEvolution(HasEvolutionTrigger, HasGender):
2016-03-05 09:27:25 +00:00
evolution_item = models.ForeignKey(Item, blank=True, null=True, related_name='evolution_item')
2016-03-05 09:27:25 +00:00
evolved_species = models.ForeignKey(
PokemonSpecies, related_name="evolved_species", blank=True, null=True)
2016-03-05 09:27:25 +00:00
min_level = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
location = models.ForeignKey(Location, related_name="location", blank=True, null=True)
2016-03-05 09:27:25 +00:00
held_item = models.ForeignKey(Item, blank=True, null=True, related_name='held_item')
2016-03-05 09:27:25 +00:00
time_of_day = models.CharField(max_length=10, blank=True, null=True)
2016-03-05 09:27:25 +00:00
known_move = models.ForeignKey(Move, blank=True, null=True)
2016-03-05 09:27:25 +00:00
known_move_type = models.ForeignKey(Type, related_name="known_move", blank=True, null=True)
2016-03-05 09:27:25 +00:00
min_happiness = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
min_beauty = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
min_affection = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
relative_physical_stats = models.IntegerField(blank=True, null=True)
2016-03-05 09:27:25 +00:00
party_species = models.ForeignKey(
PokemonSpecies, related_name="party_species", blank=True, null=True)
2016-03-05 09:27:25 +00:00
party_type = models.ForeignKey(Type, related_name="party_type", blank=True, null=True)
2016-03-05 09:27:25 +00:00
trade_species = models.ForeignKey(
PokemonSpecies, related_name="trade_species", blank=True, null=True)
2016-03-05 09:27:25 +00:00
needs_overworld_rain = models.BooleanField(default=False)
2016-03-05 09:27:25 +00:00
turn_upside_down = models.BooleanField(default=False)
class PokemonForm(HasName, HasPokemon, HasOrder):
2016-03-05 09:27:25 +00:00
form_name = models.CharField(max_length=30)
2016-03-05 09:27:25 +00:00
version_group = models.ForeignKey(VersionGroup, blank=True, null=True)
2016-03-05 09:27:25 +00:00
is_default = models.BooleanField(default=False)
2016-03-05 09:27:25 +00:00
is_battle_only = models.BooleanField(default=False)
2016-03-05 09:27:25 +00:00
is_mega = models.BooleanField(default=False)
2016-03-05 09:27:25 +00:00
form_order = models.IntegerField(blank=True, null=True)
class PokemonFormGeneration(HasPokemonForm, HasGeneration, HasGameIndex):
2016-03-05 09:27:25 +00:00
pass
class PokemonFormName(HasPokemonForm, IsName):
2016-03-05 09:27:25 +00:00
pokemon_name = models.CharField(max_length=30)
class PokemonFormSprites(HasPokemonForm):
2016-03-05 09:27:25 +00:00
sprites = models.CharField(max_length=500)
class PokemonGameIndex(HasPokemon, HasGameIndex, HasVersion):
2016-03-05 09:27:25 +00:00
pass
class PokemonHabitat(HasName):
2016-03-05 09:27:25 +00:00
pass
class PokemonHabitatName(IsName):
2016-03-05 09:27:25 +00:00
pokemon_habitat = models.ForeignKey(
PokemonHabitat, blank=True, null=True, related_name="%(class)s")
class PokemonItem(HasPokemon, HasVersion, HasItem):
2016-03-05 09:27:25 +00:00
rarity = models.IntegerField()
2016-03-05 09:27:25 +00:00
# PokemonMoveMethod
class MoveLearnMethod(HasName):
2016-03-05 09:27:25 +00:00
pass
2016-03-05 09:27:25 +00:00
# PokemonMoveMethodName
class MoveLearnMethodName(IsName, HasMoveLearnMethod):
2016-03-05 09:27:25 +00:00
pass
class MoveLearnMethodDescription(IsDescription, HasMoveLearnMethod):
2016-03-05 09:27:25 +00:00
pass
class PokemonMove(HasPokemon, HasMoveLearnMethod, HasVersionGroup, HasMove, HasOrder):
2016-03-05 09:27:25 +00:00
level = models.IntegerField()
class PokemonShape(HasName):
2016-03-05 09:27:25 +00:00
pass
class PokemonShapeName(IsName):
2016-03-05 09:27:25 +00:00
awesome_name = models.CharField(max_length=30)
2016-03-05 09:27:25 +00:00
pokemon_shape = models.ForeignKey(
PokemonShape, blank=True, null=True, related_name="pokemonshapename")
class PokemonStat(HasPokemon, HasStat):
2016-03-05 09:27:25 +00:00
base_stat = models.IntegerField()
2016-03-05 09:27:25 +00:00
effort = models.IntegerField()
class PokemonType(HasPokemon, HasType):
2016-03-05 09:27:25 +00:00
slot = models.IntegerField()
2016-02-10 04:11:37 +00:00
2016-02-13 04:44:08 +00:00
class PokemonSprites(HasPokemon):
2016-03-05 09:27:25 +00:00
sprites = models.CharField(max_length=500)