Get alpha clones in the database

This commit is contained in:
blitzman
2016-12-11 15:44:14 -05:00
parent 2b3e646213
commit b6420b9a4b
6 changed files with 86 additions and 3 deletions

View File

@@ -1,2 +1,2 @@
__all__ = ["attribute", "category", "effect", "group", "metaData",
"icon", "item", "marketGroup", "metaGroup", "unit"]
"icon", "item", "marketGroup", "metaGroup", "unit", "alphaClones"]

View File

@@ -0,0 +1,45 @@
# ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# eos is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================
from sqlalchemy import Column, String, Integer, Table, ForeignKey
from sqlalchemy.orm import relation, mapper
from eos.db import gamedata_meta
from eos.types import AlphaClone, AlphaCloneSkill
alphaclones_table = Table("alphaClones", gamedata_meta,
Column("alphaCloneID", Integer, primary_key=True),
Column("alphaCloneName", String),
)
alphacloneskskills_table = Table("alphaCloneSkills", gamedata_meta,
Column("alphaCloneID", Integer, ForeignKey("alphaClones.alphaCloneID"), primary_key=True),
Column("typeID", Integer, primary_key=True),
Column("level", Integer),
)
mapper(AlphaClone, alphaclones_table,
properties={
"_AlphaClone__skills": relation(
AlphaCloneSkill,
cascade="all,delete-orphan",
backref="clone")
})
mapper(AlphaCloneSkill, alphacloneskskills_table)

View File

@@ -33,6 +33,7 @@ characters_table = Table("characters", saveddata_meta,
Column("defaultChar", Integer),
Column("chars", String, nullable=True),
Column("defaultLevel", Integer, nullable=True),
Column("alphaClone", Integer, nullable=True),
Column("ownerID", ForeignKey("users.ID"), nullable=True))
mapper(Character, characters_table,

View File

@@ -444,6 +444,14 @@ class Category(EqBase):
pass
class AlphaClone(EqBase):
pass
class AlphaCloneSkill(EqBase):
pass
class Group(EqBase):
pass

View File

@@ -18,7 +18,8 @@
# ===============================================================================
from eos.gamedata import Attribute, Category, Effect, Group, Icon, Item, MarketGroup, \
MetaGroup, AttributeInfo, Unit, EffectInfo, MetaType, MetaData, Traits
MetaGroup, AttributeInfo, Unit, EffectInfo, MetaType, MetaData, Traits, AlphaClone, \
AlphaCloneSkill
from eos.saveddata.price import Price
from eos.saveddata.user import User
from eos.saveddata.crestchar import CrestChar