Created
November 30, 2015 09:58
-
-
Save LordNoteworthy/266b68b9dd9fb39307cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gevent | |
libevent | |
greenlet | |
eventlet | |
class Sample(Base): | |
__tablename__ = 'samples' | |
id = Column(Integer, primary_key=True) | |
sha256 = Column(String, nullable=False, unique=True, index=True) | |
time_received = Column(DateTime, nullable=False, index=True) | |
time_analyzed = Column(DateTime, nullable=False, index=True) | |
scanner_id = Column(Integer, ForeignKey('scanners.id'), index=True) | |
category_id = Column(Integer, ForeignKey('categories.id'), index=True) | |
groups_ = relationship('Group', secondary='sample_group_link') | |
class Scanner(Base): | |
__tablename__ = 'scanners' | |
id = Column(Integer, primary_key=True) | |
detection = Column(String(64), unique=True, index=True) | |
class Category(Base): | |
__tablename__ = 'categories' | |
id = Column(Integer, primary_key=True) | |
name = Column(String, unique=True, nullable=False, index=True) | |
class Group(Base): | |
__tablename__ = 'groups' | |
id = Column(Integer, primary_key=True) | |
name = Column(String, nullable=False, index=True) | |
date_created = Column(Date, default=datetime.date.today(), index=True) | |
comment = Column(String) | |
samples_ = relationship('Sample', secondary='sample_group_link') | |
class SampleGroupLink(Base): | |
__tablename__ = 'sample_group_link' | |
sample_id = Column(Integer, ForeignKey('samples.id'), primary_key=True) | |
group_id = Column(Integer, ForeignKey('groups.id'), primary_key=True) | |
sample = relationship('Sample', backref=backref('groups')) | |
group = relationship('Group', backref=backref('samples')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment