# Path: cliche/sqltypes.py
# class HashableLocale(Locale):
#     """Hashable Locale"""
# 
#     def __hash__(self):
#         return hash('{}_{}'.format(self.language, self.territory))


from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, String
from cliche.name import Name, Nameable
from cliche.sqltypes import HashableLocale as Locale



class NameableNumber(Nameable):
    __tablename__ = 'nameable_numbers'
    __mapper_args__ = {
        'polymorphic_identity': 'nameable_numbers',
    }

    id = Column(Integer, ForeignKey(Nameable.id), primary_key=True)
    number = Column(Integer, primary_key=True)


class NameableString(Nameable):
    __tablename__ = 'nameable_strings'
    __mapper_args__ = {
        'polymorphic_identity': 'nameable_strings',
    }

    id = Column(Integer, ForeignKey(Nameable.id), primary_key=True)
    string = Column(String, primary_key=True)


def test_name(fx_session):

# Path: cliche/sqltypes.py
# class HashableLocale(Locale):
#     """Hashable Locale"""
# 
#     def __hash__(self):
#         return hash('{}_{}'.format(self.language, self.territory))


# Path: tests/name_test.py
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, String
from cliche.name import Name, Nameable
from cliche.sqltypes import HashableLocale as Locale




class NameableNumber(Nameable):
    __tablename__ = 'nameable_numbers'
    __mapper_args__ = {
        'polymorphic_identity': 'nameable_numbers',
    }

    id = Column(Integer, ForeignKey(Nameable.id), primary_key=True)
    number = Column(Integer, primary_key=True)


class NameableString(Nameable):
    __tablename__ = 'nameable_strings'
    __mapper_args__ = {
        'polymorphic_identity': 'nameable_strings',
    }

    id = Column(Integer, ForeignKey(Nameable.id), primary_key=True)
    string = Column(String, primary_key=True)


def test_name(fx_session):

    kokr = Locale.parse('ko_KR')  # Korean (South Korea)