# Path: database.py
# class DB(object):
# class ImposterBase(object):
#     def __init__(self, dbstring):
#     def get_session(self):
#     def to_dict(obj):
#     def get_public_dict(obj):
# 
# Path: config.py
# TABLEPREFIX = 'imposter_'


from sqlalchemy import Table, Column, Integer, String, Text, DateTime, ForeignKey
from sqlalchemy.orm import mapper, relation, relationship, backref
from database import Base, ImposterBase
from time import strftime
from config import TABLEPREFIX
from flaskjk import markup_to_html, multi_replace

def tn(tablename):
    """ shortcut to get tablename with prefix """
    return '%s%s' % (TABLEPREFIX, tablename)

post_tags = Table(tn('post_tags'), Base.metadata,
             Column('post_id', Integer, ForeignKey('%s.id' % tn('posts'))),
             Column('tag_id', Integer, ForeignKey('%s.id' % tn('tags')))
             )

class Status(Base,ImposterBase):
    __tablename__ = tn('status')

    id = Column(Integer, primary_key=True)
    value = Column(String(32), unique=True)

    __public_columns__ = [ value ]

    def __init__(self, value):
        self.value = value

    def __unicode__(self):
        return self.value

    def __repr__(self):
        return '<Status %r>' % self.value


# Path: database.py
# class DB(object):
# class ImposterBase(object):
#     def __init__(self, dbstring):
#     def get_session(self):
#     def to_dict(obj):
#     def get_public_dict(obj):
# 
# Path: config.py
# TABLEPREFIX = 'imposter_'


# Path: models.py
from sqlalchemy import Table, Column, Integer, String, Text, DateTime, ForeignKey
from sqlalchemy.orm import mapper, relation, relationship, backref
from database import Base, ImposterBase
from time import strftime
from config import TABLEPREFIX
from flaskjk import markup_to_html, multi_replace


def tn(tablename):
    """ shortcut to get tablename with prefix """
    return '%s%s' % (TABLEPREFIX, tablename)

post_tags = Table(tn('post_tags'), Base.metadata,
             Column('post_id', Integer, ForeignKey('%s.id' % tn('posts'))),
             Column('tag_id', Integer, ForeignKey('%s.id' % tn('tags')))
             )

class Status(Base,ImposterBase):
    __tablename__ = tn('status')

    id = Column(Integer, primary_key=True)
    value = Column(String(32), unique=True)

    __public_columns__ = [ value ]

    def __init__(self, value):
        self.value = value

    def __unicode__(self):
        return self.value

    def __repr__(self):
        return '<Status %r>' % self.value


class Format(Base,ImposterBase):