# Path: pokedex/db/markdown.py
# class MarkdownString(object):
# class MoveEffectProperty(object):
# class MoveEffectPropertyMap(MoveEffectProperty):
# class PokedexLinkPattern(markdown.inlinepatterns.Pattern):
# class EscapeHtml(markdown.Extension):
# class PokedexLinkExtension(markdown.Extension):
#     def __init__(self, source_text, session, language):
#     def __str__(self):
#     def __html__(self):
#     def as_html(self, extension=None):
#     def as_text(self):
#         def handleMatch(m):
# def _markdownify_effect_text(move, effect_text, language=None):
#     def __init__(self, effect_column, relationship='move_effect'):
#     def __get__(self, obj, cls):
#     def __get__(self, obj, cls):
#     def __init__(self, factory, session, string_language=None, game_language=None):
#     def handleMatch(self, m):
#     def extendMarkdown(self, md, md_globals):
#     def __init__(self, session):
#     def extendMarkdown(self, md, md_globals):
#     def make_link(self, category, obj, url, text):
#     def identifier_url(self, category, identifier):
#     def object_url(self, category, obj):
# 
# Path: pokedex/db/multilang.py
# class LocalAssociationProxy(AssociationProxy, ColumnOperators):
# class MultilangQuery(Query):
# class MultilangSession(Session):
# class MultilangScopedSession(ScopedSession):
#     def __clause_element__(self):
#     def operate(self, op, *other, **kwargs):
# def _getset_factory_factory(column_name, string_getter):
#     def getset_factory(underlying_type, instance):
#         def getter(translations):
#         def setter(translations, value):
# def create_translation_table(_table_name, foreign_class, relation_name,
#     language_class, relation_lazy='select', **kwargs):
#         def creator(language, value):
#     def _execute_and_instances(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def default_language_id(self):
#     def default_language_id(self, new):
#     def markdown_extension(self):


from functools import partial
from sqlalchemy import Column, ForeignKey, MetaData, PrimaryKeyConstraint, UniqueConstraint
from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import backref, relationship
from sqlalchemy.sql import and_
from sqlalchemy.types import Boolean, Enum, Integer, SmallInteger, Unicode, UnicodeText
from pokedex.db import markdown, multilang
import six
class MoveFlag(TableBase):
    u"""A Move attribute such as "snatchable" or "contact". """
    __tablename__ = 'move_flags'
    __singlename__ = 'move_flag'
    id = Column(Integer, primary_key=True, nullable=False,
        doc=u"A numeric ID")
    identifier = Column(Unicode(79), nullable=False,
        doc=u"A short identifier for the flag",
        info=dict(format='identifier'))

class MoveFlagMap(TableBase):
    u"""Maps a move flag to a move."""
    __tablename__ = 'move_flag_map'
    move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False,
        doc=u"ID of the move")
    move_flag_id = Column(Integer, ForeignKey('move_flags.id'), primary_key=True, nullable=False, autoincrement=False,
        doc=u"ID of the flag")

create_translation_table('move_flag_prose', MoveFlag, 'prose',
    relation_lazy='joined',
    name = Column(Unicode(79), nullable=True, index=True,
        doc=u"The name",
        info=dict(format='plaintext', official=False)),
    description = Column(UnicodeText, nullable=True,
        doc=u"A short description of the flag",
        info=dict(format='markdown', string_getter=markdown.MarkdownString)),
)

class MoveFlavorText(TableBase):
    u"""In-game description of a move."""

# Path: pokedex/db/markdown.py
# class MarkdownString(object):
# class MoveEffectProperty(object):
# class MoveEffectPropertyMap(MoveEffectProperty):
# class PokedexLinkPattern(markdown.inlinepatterns.Pattern):
# class EscapeHtml(markdown.Extension):
# class PokedexLinkExtension(markdown.Extension):
#     def __init__(self, source_text, session, language):
#     def __str__(self):
#     def __html__(self):
#     def as_html(self, extension=None):
#     def as_text(self):
#         def handleMatch(m):
# def _markdownify_effect_text(move, effect_text, language=None):
#     def __init__(self, effect_column, relationship='move_effect'):
#     def __get__(self, obj, cls):
#     def __get__(self, obj, cls):
#     def __init__(self, factory, session, string_language=None, game_language=None):
#     def handleMatch(self, m):
#     def extendMarkdown(self, md, md_globals):
#     def __init__(self, session):
#     def extendMarkdown(self, md, md_globals):
#     def make_link(self, category, obj, url, text):
#     def identifier_url(self, category, identifier):
#     def object_url(self, category, obj):
# 
# Path: pokedex/db/multilang.py
# class LocalAssociationProxy(AssociationProxy, ColumnOperators):
# class MultilangQuery(Query):
# class MultilangSession(Session):
# class MultilangScopedSession(ScopedSession):
#     def __clause_element__(self):
#     def operate(self, op, *other, **kwargs):
# def _getset_factory_factory(column_name, string_getter):
#     def getset_factory(underlying_type, instance):
#         def getter(translations):
#         def setter(translations, value):
# def create_translation_table(_table_name, foreign_class, relation_name,
#     language_class, relation_lazy='select', **kwargs):
#         def creator(language, value):
#     def _execute_and_instances(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def default_language_id(self):
#     def default_language_id(self, new):
#     def markdown_extension(self):


# Path: pokedex/db/tables.py
from functools import partial
from sqlalchemy import Column, ForeignKey, MetaData, PrimaryKeyConstraint, UniqueConstraint
from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import backref, relationship
from sqlalchemy.sql import and_
from sqlalchemy.types import Boolean, Enum, Integer, SmallInteger, Unicode, UnicodeText
from pokedex.db import markdown, multilang
import six

class MoveFlag(TableBase):
    u"""A Move attribute such as "snatchable" or "contact". """
    __tablename__ = 'move_flags'
    __singlename__ = 'move_flag'
    id = Column(Integer, primary_key=True, nullable=False,
        doc=u"A numeric ID")
    identifier = Column(Unicode(79), nullable=False,
        doc=u"A short identifier for the flag",
        info=dict(format='identifier'))

class MoveFlagMap(TableBase):
    u"""Maps a move flag to a move."""
    __tablename__ = 'move_flag_map'
    move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False,
        doc=u"ID of the move")
    move_flag_id = Column(Integer, ForeignKey('move_flags.id'), primary_key=True, nullable=False, autoincrement=False,
        doc=u"ID of the flag")

create_translation_table('move_flag_prose', MoveFlag, 'prose',
    relation_lazy='joined',
    name = Column(Unicode(79), nullable=True, index=True,
        doc=u"The name",
        info=dict(format='plaintext', official=False)),
    description = Column(UnicodeText, nullable=True,
        doc=u"A short description of the flag",
        info=dict(format='markdown', string_getter=markdown.MarkdownString)),
)

class MoveFlavorText(TableBase):
    u"""In-game description of a move."""

    __tablename__ = 'move_flavor_text'