My game will have a class hierarchy like this:Player:    int level    int xp    list[Skill] skillsSkill:    str name    int level    int max_levelEach player to join the server will get an unique Player instance tied to his account's name.There are multiple different skills available, stuff like bonus damage and life steal (heal yourself upon damaging an enemy).They all react to events happening in the game, such as player attacking another player.What it currently looks like is this:class Player:    def __init__(self, level=0, xp=0, skills=None):        self.level = level        self.xp = xp        self.skills = skills or []class Skill:    def __init__(self, level=0):        self.levelclass BonusDamage(Skill):    name = Bonus Damage    max_level = 10    def on_attack(self, player, target, **event_args):        target.take_damage(self.level, source=player)class LifeSteal(Skill):    name = Life Steal    max_level = 3    def on_attack(self, player, damage, **event_args):        player.heal(0.1 * self.level * damage)And here are some of the events:players = {}@Event('player_join')def on_join(event_args):    player = players[event_args['playerid']] = Player()    for skill in get_subclasses(Skill):  # [BonusDamage, LifeSteal]        player.skills.append(skill())@Event('player_attack')def on_attack(event_args):    player = players[event_args['playerid']]    for skill in player.skills:        if hasattr(skill, 'on_attack'):            skill.on_attack(**event_args)So, as you can see, there are multiple different types of skills and each player receives a separate instance of each available skill.I know how to implement all the SQLAlchemy's querying and stuff, but what I don't know is how to turn my existing classes into model classes, since it's this kind of factory style where I create multiple subclasses which then create instances. How would I turn these into SQLAlchemy's models?
Creating a class factory typish RPG system with SQLAlchemy support
python;sql;python 3.x