# Path: models.py
# class Format(Base,ImposterBase):
#     __tablename__ = tn('formats')
#     id = Column(Integer, primary_key=True)
#     value = Column(String(32), nullable=False, unique=True)
# 
#     __public_columns__ = [ value ]
# 
#     def __init__(self, value):
#         self.value = value
# 
#     def __unicode__(self):
#         return self.value
# 
#     def __repr__(self):
#         return '<Format %r>' % self.value
# 
# 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 Tag(Base,ImposterBase):
#     __tablename__ = tn('tags')
# 
#     id = Column(Integer, primary_key=True)
#     value = Column(String(64), nullable=False, unique=True)
#     count = Column(Integer, default=0)
# 
#     __public_columns__ = [ value, count ]
# 
#     def __init__(self, value):
#         self.value = value
# 
#     def __unicode__(self):
#         return self.value
# 
#     def __repr__(self):
#         return '<Tag %r>' % self.value


from flaskext.wtf import Form, TextField, PasswordField, DateTimeField, SelectField, TextAreaField, FieldList, Required
from wtforms.fields import Field
from wtforms.widgets import TextInput
from models import Format, Status, Tag
# -*- coding: utf-8 -*-
# Description {{{
"""
    imposter.forms
    ~~~~~~~~~~~~~~

    WTForms classes for creating forms and input validation.

    :copyright: (c) 2010-2011 by Jochem Kossen.
    :license: BSD, see LICENSE.txt for more details.
"""
# }}}

# Imports {{{
# }}}

# Helper functions {{{
def get_format(value):
    """Retrieve Format object based on given String"""

# Path: models.py
# class Format(Base,ImposterBase):
#     __tablename__ = tn('formats')
#     id = Column(Integer, primary_key=True)
#     value = Column(String(32), nullable=False, unique=True)
# 
#     __public_columns__ = [ value ]
# 
#     def __init__(self, value):
#         self.value = value
# 
#     def __unicode__(self):
#         return self.value
# 
#     def __repr__(self):
#         return '<Format %r>' % self.value
# 
# 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 Tag(Base,ImposterBase):
#     __tablename__ = tn('tags')
# 
#     id = Column(Integer, primary_key=True)
#     value = Column(String(64), nullable=False, unique=True)
#     count = Column(Integer, default=0)
# 
#     __public_columns__ = [ value, count ]
# 
#     def __init__(self, value):
#         self.value = value
# 
#     def __unicode__(self):
#         return self.value
# 
#     def __repr__(self):
#         return '<Tag %r>' % self.value


# Path: forms.py
from flaskext.wtf import Form, TextField, PasswordField, DateTimeField, SelectField, TextAreaField, FieldList, Required
from wtforms.fields import Field
from wtforms.widgets import TextInput
from models import Format, Status, Tag

# -*- coding: utf-8 -*-
# Description {{{
"""
    imposter.forms
    ~~~~~~~~~~~~~~

    WTForms classes for creating forms and input validation.

    :copyright: (c) 2010-2011 by Jochem Kossen.
    :license: BSD, see LICENSE.txt for more details.
"""
# }}}

# Imports {{{
# }}}

# Helper functions {{{
def get_format(value):
    """Retrieve Format object based on given String"""

    query = Format.query.filter(Format.value==value)