rr- 9aea55e3d1 server/general: embrace most of PEP8
Ignored only the rules about continuing / hanging indentation.

Also, added __init__.py to tests so that pylint discovers them. (I don't
buy pytest's BS about installing your package.)
2016-08-14 16:44:03 +02:00

25 lines
898 B
Python

from sqlalchemy.orm import relationship
from sqlalchemy import (
Column, Integer, DateTime, Unicode, PickleType, ForeignKey)
from szurubooru.db.base import Base
class Snapshot(Base):
__tablename__ = 'snapshot'
OPERATION_CREATED = 'created'
OPERATION_MODIFIED = 'modified'
OPERATION_DELETED = 'deleted'
snapshot_id = Column('id', Integer, primary_key=True)
creation_time = Column('creation_time', DateTime, nullable=False)
resource_type = Column(
'resource_type', Unicode(32), nullable=False, index=True)
resource_id = Column('resource_id', Integer, nullable=False, index=True)
resource_repr = Column('resource_repr', Unicode(64), nullable=False)
operation = Column('operation', Unicode(16), nullable=False)
user_id = Column('user_id', Integer, ForeignKey('user.id'))
data = Column('data', PickleType)
user = relationship('User')