Skip to content

Instantly share code, notes, and snippets.

@niktto
Created December 8, 2012 14:02
Show Gist options
  • Save niktto/4240370 to your computer and use it in GitHub Desktop.
Save niktto/4240370 to your computer and use it in GitHub Desktop.
Problem z okreslaniem kolumn na bazie listy stringów
(...)
class Character(Base):
__tablename__ = 'characters'
uid = Column(Integer, primary_key=True)
session = Column(Integer, ForeignKey('sessions.uid'))
created = Column(DateTime, default=datetime.datetime.utcnow)
name = Column(Unicode(255))
# Body health
for part in BODY.keys():
Column(part, Integer)
# Stats
for stat in STATS.keys():
Column('stat_' + stat, Integer)
# Skills
for skill in SKILLS.keys():
Column('skill_' + skill, Integer)
(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment