Created
December 29, 2016 22:36
-
-
Save nemith/d6a2575416886b1ec301a187f2a84147 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
RulesSrcObjects = Table('rules_src_objects', | |
Column('id', Integer, primary_key=True), | |
Column('rule_id', Integer, ForeignKey('Rule.id')), | |
Column('object_id', Integer, ForeignKey('Object.id')), | |
RulesDstbjects = Table('rules_dst_objects', | |
Column('id', Integer, primary_key=True), | |
Column('rule_id', Integer, ForeignKey('Rule.id')), | |
Column('object_id', Integer, ForeignKey('Object.id')), | |
Class Object(Base): | |
__tablename__ = 'objects' | |
id = Column(Integer) | |
name = Column(String, primary_key=True) | |
ip = Column(string) | |
port = Column(int | |
proto = Column(int) | |
src_rules = relationship('Rule', secondary=RuleSrcObjects) | |
dst_rules = relationship('Rule', secondary=RuleDstObjects) | |
Class Rule(Base): | |
__tablename__ = 'rules' | |
rulename = Column(String, primary_key=True) | |
src_objects = relationship('Objects', secondary=RulesSrcObjects) | |
dst_objects = relationship('Objects', secondary=RulesDstObjects) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment