Beispiel #1
0
class ProductsModel(db.Model):
    __tablename__ = 'Products'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)  # Id
    name = db.Column(db.String(64), unique=True,
                     nullable=False)  # Product name
    schema = db.Column(db.String(64), nullable=False)  # Schema
    table = db.Column(db.String(64), nullable=False)  # Table
Beispiel #2
0
class SeedsModel(db.Model):
    __tablename__ = 'Seeds'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    name = db.Column(db.String(255), nullable=False)                                # File name
    digest = db.Column(db.String(255), default=None)                                # Digest of file
    created = db.Column(db.DateTime, default=datetime.datetime.utcnow)              # Creation time
    updated = db.Column(db.DateTime, default=datetime.datetime.utcnow)              # Updation time

    def insert(self):
        self.updated = datetime.datetime.utcnow()
        db.session.add(self)
        db.session.commit()
Beispiel #3
0
class JirasModel(db.Model):
    __tablename__ = 'Jiras'
    Key = db.Column(db.String(16), primary_key=True)  # Key of this jira
    Status = db.Column(db.String(32), nullable=False)  # Status of this jira
    Description = db.Column(db.String(16384))  # Description for this group
    Created = db.Column(db.DateTime, nullable=False)  # Creation time
    Duration = db.Column(db.Integer, default=0)  # Time to Resolution
    IssueType = db.Column(db.String(16), nullable=False)  # Issue type
    CustomerRequestType = db.Column(db.String(32),
                                    nullable=False)  # Request Type
    Resolution = db.Column(db.String(16), nullable=False)  # Resolution

    def insert(self):
        db.session.add(self)
        db.session.commit()
Beispiel #4
0
class UsersModel(UserMixin, BaseModel):
    __tablename__ = 'Users'
    email = db.Column(db.String(128), primary_key=True)                 # Email
    name = db.Column(db.String(128), nullable=False)                    # Name
    department = db.Column(db.String(32), default='OTHERS')             # Department
Beispiel #5
0
class JobsModel(BaseModel):
    __tablename__ = 'Jobs'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)  # Id
    job_title = db.Column(db.String(32), nullable=False)  # Title
    submit_type = db.Column(db.Enum(SubmitType),
                            default=SubmitType.hddsn)  # Submit Type
    treatment_name = db.Column(db.String(32), nullable=False)  # Treatment Name
    # Treatment list?
    control_name = db.Column(db.String(32), nullable=False)  # Control Name
    # Control list?
    use_control_list = db.Column(db.Boolean,
                                 default=False)  # Uses control list
    status = db.Column(db.String(32), nullable=False)  # Status
    analytics_level = db.Column(db.Integer, default=0)  # Analytics Level
    product = db.Column(db.String(32), nullable=False)  # Product
    target_data = db.Column(db.String(32), nullable=False)  # Target Data
    # Match Key
    # Compare Key
    match_key_p_mode = db.Column(db.Enum(MatchKeyPMode),
                                 default=MatchKeyPMode.Auto)  # Submit Type
    # Match Key P
    # Compare Key P
    duration = db.Column(db.Integer, default=0)  # Time to process
    detail = db.Column(db.String(128), default='Job is queued.')
    user_email = db.Column(db.String(128), db.ForeignKey('Users.email'))
    Users = db.relationship('UsersModel', lazy='joined')