# Path: database.py
# def get_session():
# def teardown_session(exception):


from database import TableBase, Column, ForeignKey, \
    Integer, INTEGER, TINYINT, VARCHAR, LONGTEXT, DATE, DATETIME, TEXT, BINARY, DOUBLE
    review_count = Column(INTEGER(4))
    review_total = Column(INTEGER(4))
    flag = Column(INTEGER(4))
    sequence_length = Column(INTEGER(11))
    temp_1 = Column(INTEGER(11))
    temp_2 = Column(INTEGER(11))
    temp_3 = Column(INTEGER(11))
    temp4 = Column(INTEGER(11))
    rating = Column(INTEGER(11))

    owner = Column(Integer, ForeignKey('user.user_id'))

    def __set_by_kwargs__(self, **kwargs):
        for k, v in kwargs.items():
            setattr(self, k, v)

    def __get_info__(self):
        values = {}
        for k in dir(self):
            if k.startswith('_'):
                continue
            values[k] = getattr(self, k)
        features = []
        for feature in session.query(BioBrickFeature).filter(BioBrickFeature.part_id == self):
            features.append({})
            for k in dir(feature):
                if k.startswith('_'):
                    continue
                features[-1][k] = getattr(feature, k)
        values['features'] = features

# Path: database.py
# def get_session():
# def teardown_session(exception):


# Path: plugins/biobrick_manager/BiobrickUser.py
from database import TableBase, Column, ForeignKey, \
    Integer, INTEGER, TINYINT, VARCHAR, LONGTEXT, DATE, DATETIME, TEXT, BINARY, DOUBLE

    review_count = Column(INTEGER(4))
    review_total = Column(INTEGER(4))
    flag = Column(INTEGER(4))
    sequence_length = Column(INTEGER(11))
    temp_1 = Column(INTEGER(11))
    temp_2 = Column(INTEGER(11))
    temp_3 = Column(INTEGER(11))
    temp4 = Column(INTEGER(11))
    rating = Column(INTEGER(11))

    owner = Column(Integer, ForeignKey('user.user_id'))

    def __set_by_kwargs__(self, **kwargs):
        for k, v in kwargs.items():
            setattr(self, k, v)

    def __get_info__(self):
        values = {}
        for k in dir(self):
            if k.startswith('_'):
                continue
            values[k] = getattr(self, k)
        features = []
        for feature in session.query(BioBrickFeature).filter(BioBrickFeature.part_id == self):
            features.append({})
            for k in dir(feature):
                if k.startswith('_'):
                    continue
                features[-1][k] = getattr(feature, k)
        values['features'] = features

        return values