Пример #1
0
class AccAuthorization(db.Model):
    """Represents a AccAssociation record."""
    __tablename__ = 'accROLE_accACTION_accARGUMENT'
    id_accROLE = db.Column(db.Integer(15, unsigned=True),
                           db.ForeignKey(AccROLE.id),
                           nullable=True,
                           autoincrement=False,
                           primary_key=True,
                           index=True)
    id_accACTION = db.Column(db.Integer(15, unsigned=True),
                             db.ForeignKey(AccACTION.id),
                             nullable=True,
                             autoincrement=False,
                             primary_key=True,
                             index=True)
    id_accARGUMENT = db.Column(
        db.Integer(15),  # , unsigned=True),
        db.ForeignKey(AccARGUMENT.id),
        nullable=True,
        primary_key=True,
        autoincrement=False,
        index=True)
    argumentlistid = db.Column(db.MediumInteger(8),
                               nullable=True,
                               autoincrement=False,
                               primary_key=True)
    role = db.relationship(AccROLE, backref='authorizations')
    action = db.relationship(AccACTION, backref='authorizations')
    argument = db.relationship(AccARGUMENT, backref='authorizations')
Пример #2
0
class CmtSUBSCRIPTION(db.Model):
    """Represents a CmtSUBSCRIPTION record."""
    __tablename__ = 'cmtSUBSCRIPTION'

    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          nullable=False,
                          primary_key=True)
    id_user = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(User.id),
                        nullable=False,
                        primary_key=True)
    creation_time = db.Column(db.DateTime,
                              nullable=False,
                              server_default='1900-01-01 00:00:00')

    bibrec = db.relationship(Bibrec)
    user = db.relationship(User, backref='comment_subscriptions')
    user_commented_records = db.relationship(
        Bibrec,
        backref='user_comment_subscritions',
        primaryjoin=lambda: db.and_(
            CmtSUBSCRIPTION.id_bibrec == Bibrec.id, CmtSUBSCRIPTION.id_user ==
            current_user.get_id()),
        viewonly=True)
Пример #3
0
class RnkDOWNLOADS(db.Model):
    """Represents a RnkDOWNLOADS record."""
    __tablename__ = 'rnkDOWNLOADS'
    id = db.Column(db.Integer,
                   primary_key=True,
                   nullable=False,
                   autoincrement=True)
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          nullable=True)
    download_time = db.Column(db.DateTime,
                              nullable=True,
                              server_default='1900-01-01 00:00:00')
    client_host = db.Column(db.Integer(10, unsigned=True), nullable=True)
    id_user = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(User.id),
                        nullable=True)
    id_bibdoc = db.Column(db.MediumInteger(9, unsigned=True),
                          db.ForeignKey(Bibdoc.id),
                          nullable=True)
    file_version = db.Column(db.SmallInteger(2, unsigned=True), nullable=True)
    file_format = db.Column(db.String(50), nullable=True)
    bibrec = db.relationship(Bibrec, backref='downloads')
    bibdoc = db.relationship(Bibdoc, backref='downloads')
    user = db.relationship(User, backref='downloads')
Пример #4
0
class FieldTag(db.Model):
    """Represents a FieldTag record."""
    __tablename__ = 'field_tag'
    id_field = db.Column(db.MediumInteger(9, unsigned=True),
                         db.ForeignKey('field.id'),
                         nullable=False,
                         primary_key=True)
    id_tag = db.Column(db.MediumInteger(9, unsigned=True),
                       db.ForeignKey('tag.id'),
                       nullable=False,
                       primary_key=True)
    score = db.Column(db.TinyInteger(4, unsigned=True),
                      nullable=False,
                      server_default='0')
    tag = db.relationship(Tag, backref='fields', order_by=score)
    field = db.relationship(Field, backref='tags', order_by=score)

    def __init__(self, score=None, tup=None, *args, **kwargs):
        if score is not None:
            self.score = score
        if tup is not None:
            self.tag = Tag(tup)
        super(FieldTag, self).__init__(*args, **kwargs)

    @property
    def as_tag(self):
        """ Returns Tag record directly."""
        return self.tag
Пример #5
0
class CrcPURCHASE(db.Model):
    """Represents a CrcPURCHASE record."""
    def __init__(self):
        pass

    __tablename__ = 'crcPURCHASE'
    id = db.Column(db.Integer(15, unsigned=True),
                   nullable=False,
                   primary_key=True,
                   autoincrement=True)
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          nullable=False,
                          server_default='0')
    id_crcVENDOR = db.Column(db.Integer(15, unsigned=True),
                             db.ForeignKey(CrcVENDOR.id),
                             nullable=False,
                             server_default='0')
    ordered_date = db.Column(db.DateTime,
                             nullable=False,
                             server_default='1900-01-01 00:00:00')
    expected_date = db.Column(db.DateTime,
                              nullable=False,
                              server_default='1900-01-01 00:00:00')
    price = db.Column(db.String(20), nullable=False, server_default='0')
    status = db.Column(db.String(20), nullable=False, server_default='')
    notes = db.Column(db.Text, nullable=True)
    bibrec = db.relationship(Bibrec, backref='purchases')
    vendor = db.relationship(CrcVENDOR, backref='purchases')
Пример #6
0
class CollectionFieldFieldvalue(db.Model):
    """Represents a CollectionFieldFieldvalue record."""
    __tablename__ = 'collection_field_fieldvalue'
    id_collection = db.Column(db.MediumInteger(9, unsigned=True),
                              db.ForeignKey(Collection.id),
                              primary_key=True,
                              nullable=False)
    id_field = db.Column(db.MediumInteger(9, unsigned=True),
                         db.ForeignKey(Field.id),
                         primary_key=True,
                         nullable=False)
    id_fieldvalue = db.Column(db.MediumInteger(9, unsigned=True),
                              db.ForeignKey(Fieldvalue.id),
                              primary_key=True,
                              nullable=True)
    type = db.Column(db.Char(3), nullable=False, server_default='src')
    score = db.Column(db.TinyInteger(4, unsigned=True),
                      nullable=False,
                      server_default='0')
    score_fieldvalue = db.Column(db.TinyInteger(4, unsigned=True),
                                 nullable=False,
                                 server_default='0')

    collection = db.relationship(Collection,
                                 backref='field_fieldvalues',
                                 order_by=score)
    field = db.relationship(Field,
                            backref='collection_fieldvalues',
                            lazy='joined')
    fieldvalue = db.relationship(Fieldvalue,
                                 backref='collection_fields',
                                 lazy='joined')
Пример #7
0
class OaiHARVESTLOG(db.Model):
    """Represents a OaiHARVESTLOG record."""
    __tablename__ = 'oaiHARVESTLOG'
    id_oaiHARVEST = db.Column(db.MediumInteger(9, unsigned=True),
                              db.ForeignKey(OaiHARVEST.id),
                              nullable=False)
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          nullable=False,
                          server_default='0')
    bibupload_task_id = db.Column(db.Integer(11),
                                  db.ForeignKey(SchTASK.id),
                                  nullable=False,
                                  server_default='0',
                                  primary_key=True)
    oai_id = db.Column(db.String(40),
                       nullable=False,
                       server_default='',
                       primary_key=True)
    date_harvested = db.Column(db.DateTime,
                               nullable=False,
                               server_default='1900-01-01 00:00:00',
                               primary_key=True)
    date_inserted = db.Column(db.DateTime,
                              nullable=False,
                              server_default='1900-01-01 00:00:00')
    inserted_to_db = db.Column(db.Char(1), nullable=False, server_default='P')
    bibrec = db.relationship(Bibrec, backref='harvestlogs')
    schtask = db.relationship(SchTASK)
Пример #8
0
class CrcLOANREQUEST(db.Model):
    """Represents a CrcLOANREQUEST record."""
    def __init__(self):
        pass
    __tablename__ = 'crcLOANREQUEST'
    id = db.Column(db.Integer(15, unsigned=True), nullable=False,
                primary_key=True,
                autoincrement=True)
    id_crcBORROWER = db.Column(db.Integer(15, unsigned=True),
                db.ForeignKey(CrcBORROWER.id), nullable=False, server_default='0')
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bibrec.id),
                nullable=False, server_default='0')
    barcode = db.Column(db.String(30), db.ForeignKey(CrcITEM.barcode), nullable=False,
                server_default='')
    period_of_interest_from = db.Column(db.DateTime,
                nullable=False,
                server_default='1900-01-01 00:00:00')
    period_of_interest_to = db.Column(db.DateTime,
                nullable=False,
                server_default='1900-01-01 00:00:00')
    status = db.Column(db.String(20), nullable=False,
                server_default='')
    notes = db.Column(db.Text, nullable=True)
    request_date = db.Column(db.DateTime, nullable=False,
                server_default='1900-01-01 00:00:00')
    borrower = db.relationship(CrcBORROWER, backref='loanrequests')
    bibrec = db.relationship(Bibrec, backref='loanrequests')
    item = db.relationship(CrcITEM, backref='loanrequests')
Пример #9
0
class CrcILLREQUEST(db.Model):
    """Represents a CrcILLREQUEST record."""
    def __init__(self):
        pass
    __tablename__ = 'crcILLREQUEST'
    id = db.Column(db.Integer(15, unsigned=True), nullable=False,
                primary_key=True,
                autoincrement=True)
    id_crcBORROWER = db.Column(db.Integer(15, unsigned=True),
                db.ForeignKey(CrcBORROWER.id),
                nullable=False,
                server_default='0')
    barcode = db.Column(db.String(30), db.ForeignKey(CrcITEM.barcode),
                nullable=False,
                server_default='')
    period_of_interest_from = db.Column(db.DateTime,
                nullable=False,
                server_default='1900-01-01 00:00:00')
    period_of_interest_to = db.Column(db.DateTime,
                nullable=False,
                server_default='1900-01-01 00:00:00')
    id_crcLIBRARY = db.Column(db.Integer(15, unsigned=True),
                db.ForeignKey(CrcLIBRARY.id), nullable=False,
                server_default='0')
    request_date = db.Column(db.DateTime, nullable=False,
                server_default='1900-01-01 00:00:00')
    expected_date = db.Column(db.DateTime, nullable=False,
                server_default='1900-01-01 00:00:00')
    arrival_date = db.Column(db.DateTime, nullable=False,
                server_default='1900-01-01 00:00:00')
    due_date = db.Column(db.DateTime, nullable=False,
                server_default='1900-01-01 00:00:00')
    return_date = db.Column(db.DateTime, nullable=False,
                server_default='1900-01-01 00:00:00')
    status = db.Column(db.String(20), nullable=False,
                server_default='')
    cost = db.Column(db.String(30), nullable=False,
                server_default='')
    budget_code = db.Column(db.String(60), nullable=False,
                server_default='')
    item_info = db.Column(db.Text, nullable=True)
    request_type = db.Column(db.Text, nullable=True)
    borrower_comments = db.Column(db.Text, nullable=True)
    only_this_edition = db.Column(db.String(10), nullable=False,
                server_default='')
    library_notes = db.Column(db.Text, nullable=True)
    overdue_letter_number = db.Column(db.Integer(3, unsigned=True),
                                      nullable=False, server_default='0')
    overdue_letter_date = db.Column(db.DateTime, nullable=False,
                                    server_default='1900-01-01 00:00:00')
    borrower = db.relationship(CrcBORROWER, backref='illrequests')
    item = db.relationship(CrcITEM, backref='illrequests')
    library = db.relationship(CrcLIBRARY, backref='illrequests')
Пример #10
0
class CollectionClsMETHOD(db.Model):
    """Represents a Collection_clsMETHOD record."""
    __tablename__ = 'collection_clsMETHOD'
    id_collection = db.Column(db.MediumInteger(9, unsigned=True),
                              db.ForeignKey(Collection.id),
                              primary_key=True,
                              nullable=False)
    id_clsMETHOD = db.Column(db.MediumInteger(9, unsigned=True),
                             db.ForeignKey(ClsMETHOD.id),
                             primary_key=True,
                             nullable=False)
    collection = db.relationship(Collection, backref='clsMETHODs')
    clsMETHOD = db.relationship(ClsMETHOD, backref='collections')
Пример #11
0
class ExpJOBExpQUERY(db.Model):
    """Represents a ExpJOBExpQUERY record."""
    __tablename__ = 'expJOB_expQUERY'
    id_expJOB = db.Column(db.Integer(15, unsigned=True),
                          db.ForeignKey(ExpJOB.id),
                          nullable=False,
                          primary_key=True)
    id_expQUERY = db.Column(db.Integer(15, unsigned=True),
                            db.ForeignKey(ExpQUERY.id),
                            nullable=False,
                            primary_key=True)

    query = db.relationship(ExpQUERY, backref='jobs')
    job = db.relationship(ExpJOB, backref='queries')
Пример #12
0
class CollectionExternalcollection(db.Model):
    """Represents a CollectionExternalcollection record."""
    __tablename__ = 'collection_externalcollection'
    id_collection = db.Column(db.MediumInteger(9, unsigned=True),
                              db.ForeignKey(Collection.id),
                              primary_key=True,
                              server_default='0')
    id_externalcollection = db.Column(db.MediumInteger(9, unsigned=True),
                                      db.ForeignKey(Externalcollection.id),
                                      primary_key=True,
                                      server_default='0')
    type = db.Column(db.TinyInteger(4, unsigned=True),
                     server_default='0',
                     nullable=False)

    def _collection_type(type):
        return db.relationship(
            Collection,
            primaryjoin=lambda: db.and_(
                CollectionExternalcollection.id_collection == Collection.id,
                CollectionExternalcollection.type == type),
            backref='_externalcollections_' + str(type))

    collection_0 = _collection_type(0)
    collection_1 = _collection_type(1)
    collection_2 = _collection_type(2)

    externalcollection = db.relationship(Externalcollection)
Пример #13
0
class CollectionRnkMETHOD(db.Model):
    """Represents a CollectionRnkMETHOD record."""
    __tablename__ = 'collection_rnkMETHOD'
    id_collection = db.Column(db.MediumInteger(9, unsigned=True),
                              db.ForeignKey(Collection.id),
                              primary_key=True,
                              nullable=False)
    id_rnkMETHOD = db.Column(db.MediumInteger(9, unsigned=True),
                             db.ForeignKey(RnkMETHOD.id),
                             primary_key=True,
                             nullable=False)
    score = db.Column(db.TinyInteger(4, unsigned=True),
                      nullable=False,
                      server_default='0')
    collection = db.relationship(Collection, backref='rnkMETHODs')
    rnkMETHOD = db.relationship(RnkMETHOD, backref='collections')
Пример #14
0
class UserBskBASKET(db.Model):
    """Represents a UserBskBASKET record."""
    __tablename__ = 'user_bskBASKET'
    id_user = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(User.id),
                        nullable=False,
                        server_default='0',
                        primary_key=True)
    id_bskBASKET = db.Column(db.Integer(15, unsigned=True),
                             db.ForeignKey(BskBASKET.id),
                             nullable=False,
                             server_default='0',
                             primary_key=True)
    topic = db.Column(db.String(50), nullable=False, server_default='')
    user = db.relationship(User, backref='user_baskets')
    user_basket = db.relationship(BskBASKET, backref='users')
Пример #15
0
class UserAccROLE(db.Model):
    """Represents a UserAccROLE record."""
    __tablename__ = 'user_accROLE'
    id_user = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(User.id),
                        nullable=False,
                        primary_key=True)
    id_accROLE = db.Column(db.Integer(15, unsigned=True),
                           db.ForeignKey(AccROLE.id),
                           nullable=False,
                           primary_key=True)
    expiration = db.Column(db.DateTime,
                           nullable=False,
                           server_default='9999-12-31 23:59:59')
    user = db.relationship(User, backref='roles')
    role = db.relationship(AccROLE, backref='users')
Пример #16
0
 def _collection_type(type):
     return db.relationship(
         Collection,
         primaryjoin=lambda: db.and_(
             CollectionExternalcollection.id_collection == Collection.id,
             CollectionExternalcollection.type == type),
         backref='_externalcollections_' + str(type))
Пример #17
0
class CollectionExample(db.Model):
    """Represents a CollectionExample record."""
    __tablename__ = 'collection_example'
    id_collection = db.Column(db.MediumInteger(9, unsigned=True),
                              db.ForeignKey(Collection.id),
                              primary_key=True)
    id_example = db.Column(db.MediumInteger(9, unsigned=True),
                           db.ForeignKey(Example.id),
                           primary_key=True)
    score = db.Column(db.TinyInteger(4, unsigned=True),
                      nullable=False,
                      server_default='0')
    collection = db.relationship(Collection,
                                 backref='_examples',
                                 order_by=score)
    example = db.relationship(Example, backref='collections', order_by=score)
Пример #18
0
class KnwKBDDEF(db.Model):
    """Represents a KnwKBDDEF record."""
    def __init__(self):
        pass

    __tablename__ = 'knwKBDDEF'
    id_knwKB = db.Column(db.MediumInteger(8, unsigned=True),
                         db.ForeignKey(KnwKB.id),
                         nullable=False,
                         primary_key=True)
    id_collection = db.Column(db.MediumInteger(9, unsigned=True),
                              db.ForeignKey(Collection.id),
                              nullable=True)
    output_tag = db.Column(db.Text, nullable=True)
    search_expression = db.Column(db.Text, nullable=True)
    kb = db.relationship(KnwKB, backref='kbdefs')
    collection = db.relationship(Collection, backref='kbdefs')
Пример #19
0
class CrcLOAN(db.Model):
    """Represents a CrcLOAN record."""
    def __init__(self):
        pass

    __tablename__ = 'crcLOAN'
    id = db.Column(db.Integer(15, unsigned=True),
                   nullable=False,
                   primary_key=True,
                   autoincrement=True)
    id_crcBORROWER = db.Column(db.Integer(15, unsigned=True),
                               db.ForeignKey(CrcBORROWER.id),
                               nullable=False,
                               server_default='0')
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          nullable=False,
                          server_default='0')
    barcode = db.Column(db.String(30),
                        db.ForeignKey(CrcITEM.barcode),
                        nullable=False,
                        server_default='')
    loaned_on = db.Column(db.DateTime,
                          nullable=False,
                          server_default='1900-01-01 00:00:00')
    returned_on = db.Column(db.Date,
                            nullable=False,
                            server_default='0000-00-00')
    due_date = db.Column(db.DateTime,
                         nullable=False,
                         server_default='1900-01-01 00:00:00')
    number_of_renewals = db.Column(db.Integer(3, unsigned=True),
                                   nullable=False,
                                   server_default='0')
    overdue_letter_number = db.Column(db.Integer(3, unsigned=True),
                                      nullable=False,
                                      server_default='0')
    overdue_letter_date = db.Column(db.DateTime,
                                    nullable=False,
                                    server_default='1900-01-01 00:00:00')
    status = db.Column(db.String(20), nullable=False, server_default='')
    type = db.Column(db.String(20), nullable=False, server_default='')
    notes = db.Column(db.Text, nullable=True)
    borrower = db.relationship(CrcBORROWER, backref='loans')
    bibrec = db.relationship(Bibrec, backref='loans')
    item = db.relationship(CrcITEM, backref='loans')
Пример #20
0
class WtgTAGRecord(db.Model, Serializable):
    """ Represents a connection between Tag and Record """

    __tablename__ = 'wtgTAG_bibrec'
    __public__ = ['id_tag', 'id_bibrec', 'date_added']

    # tagTAG.id
    id_tag = db.Column(db.Integer(15, unsigned=True),
                       db.ForeignKey(WtgTAG.id),
                       nullable=False,
                       primary_key=True)

    # Bibrec.id
    id_bibrec = db.Column(db.Integer(15, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          nullable=False,
                          primary_key=True)

    # Creation date
    date_added = db.Column(db.DateTime, default=datetime.now)

    # Relationships
    tag = db.relationship(WtgTAG,
                          backref=db.backref('records_association',
                                             cascade='all'))

    tag_query = db.relationship(WtgTAG,
                                backref=db.backref('records_association_query',
                                                   cascade='all',
                                                   lazy='dynamic'))

    bibrec = db.relationship(Bibrec,
                             backref=db.backref('tags_association',
                                                cascade='all'))

    bibrec_query = db.relationship(Bibrec,
                                   backref=db.backref('tags_association_query',
                                                      cascade='all',
                                                      lazy='dynamic'))

    # Constructor
    def __init__(self, bibrec=None, **kwargs):
        super(WtgTAGRecord, self).__init__(**kwargs)

        self.bibrec = bibrec
Пример #21
0
class CollectionFormat(db.Model):
    """Represents a CollectionFormat record."""
    __tablename__ = 'collection_format'
    id_collection = db.Column(db.MediumInteger(9, unsigned=True),
                              db.ForeignKey(Collection.id),
                              primary_key=True)
    id_format = db.Column(db.MediumInteger(9, unsigned=True),
                          db.ForeignKey(Format.id),
                          primary_key=True)
    score = db.Column(db.TinyInteger(4, unsigned=True),
                      nullable=False,
                      server_default='0')
    collection = db.relationship(Collection,
                                 backref='formats',
                                 order_by=db.desc(score))
    format = db.relationship(Format,
                             backref='collections',
                             order_by=db.desc(score))
Пример #22
0
class SwrCLIENTDATA(db.Model):
    """Represents a SwrCLIENTDATA record."""
    def __init__(self):
        pass

    __tablename__ = 'swrCLIENTDATA'
    id = db.Column(db.Integer(15, unsigned=True),
                   nullable=False,
                   primary_key=True,
                   autoincrement=True)
    id_swrREMOTESERVER = db.Column(db.Integer(15, unsigned=True),
                                   db.ForeignKey(SwrREMOTESERVER.id),
                                   nullable=False)
    id_record = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          nullable=False)
    report_no = db.Column(db.String(50), nullable=False)
    id_remote = db.Column(db.String(50), nullable=False)
    id_user = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(User.id),
                        nullable=False)
    user_name = db.Column(db.String(100), nullable=False)
    user_email = db.Column(db.String(100), nullable=False)
    xml_media_deposit = db.Column(db.LargeBinary, nullable=False)
    xml_metadata_submit = db.Column(db.LargeBinary, nullable=False)
    submission_date = db.Column(db.DateTime,
                                nullable=False,
                                server_default='1900-01-01 00:00:00')
    publication_date = db.Column(db.DateTime,
                                 nullable=False,
                                 server_default='1900-01-01 00:00:00')
    removal_date = db.Column(db.DateTime,
                             nullable=False,
                             server_default='1900-01-01 00:00:00')
    link_medias = db.Column(db.String(150), nullable=False)
    link_metadata = db.Column(db.String(150), nullable=False)
    link_status = db.Column(db.String(150), nullable=False)
    status = db.Column(db.String(150),
                       nullable=False,
                       server_default='submitted')
    last_update = db.Column(db.DateTime, nullable=False)
    remoteserver = db.relationship(SwrREMOTESERVER, backref='clientdata')
    user = db.relationship(User, backref='clientdata')
    bibrec = db.relationship(Bibrec)
Пример #23
0
class RnkMETHODNAME(db.Model):
    """Represents a RnkMETHODNAME record."""
    __tablename__ = 'rnkMETHODNAME'
    id_rnkMETHOD = db.Column(db.MediumInteger(9, unsigned=True),
                             db.ForeignKey(RnkMETHOD.id),
                             primary_key=True)
    ln = db.Column(db.Char(5), primary_key=True, server_default='')
    type = db.Column(db.Char(3), primary_key=True, server_default='sn')
    value = db.Column(db.String(255), nullable=False)
    method = db.relationship(RnkMETHOD, backref='names')
Пример #24
0
class Fieldname(db.Model):
    """Represents a Fieldname record."""
    __tablename__ = 'fieldname'
    id_field = db.Column(db.MediumInteger(9, unsigned=True),
                         db.ForeignKey(Field.id),
                         primary_key=True)
    ln = db.Column(db.Char(5), primary_key=True, server_default='')
    type = db.Column(db.Char(3), primary_key=True, server_default='sn')
    value = db.Column(db.String(255), nullable=False)
    field = db.relationship(Field, backref='names')
Пример #25
0
class Collectiondetailedrecordpagetabs(db.Model):
    """Represents a Collectiondetailedrecordpagetabs record."""
    __tablename__ = 'collectiondetailedrecordpagetabs'
    id_collection = db.Column(db.MediumInteger(9, unsigned=True),
                              db.ForeignKey(Collection.id),
                              nullable=False,
                              primary_key=True)
    tabs = db.Column(db.String(255), nullable=False, server_default='')
    collection = db.relationship(Collection,
                                 backref='collectiondetailedrecordpagetabs')
Пример #26
0
class UserMsgMESSAGE(db.Model):
    """Represents a UserMsgMESSAGE record."""
    __tablename__ = 'user_msgMESSAGE'
    id_user_to = db.Column(db.Integer(15, unsigned=True),
                           db.ForeignKey(User.id),
                           nullable=False,
                           server_default='0',
                           primary_key=True)
    id_msgMESSAGE = db.Column(db.Integer(15, unsigned=True),
                              db.ForeignKey(MsgMESSAGE.id),
                              nullable=False,
                              server_default='0',
                              primary_key=True)
    status = db.Column(db.Char(1), nullable=False, server_default='N')
    user_to = db.relationship(User,
                              backref='received_messages',
                              collection_class=set)
    message = db.relationship(MsgMESSAGE,
                              backref='sent_to_users',
                              collection_class=set)
Пример #27
0
class UsergroupBskBASKET(db.Model):
    """Represents a UsergroupBskBASKET record."""
    __tablename__ = 'usergroup_bskBASKET'
    id_usergroup = db.Column(db.Integer(15, unsigned=True),
                             db.ForeignKey(Usergroup.id),
                             nullable=False,
                             server_default='0',
                             primary_key=True)
    id_bskBASKET = db.Column(db.Integer(15, unsigned=True),
                             db.ForeignKey(BskBASKET.id),
                             nullable=False,
                             server_default='0',
                             primary_key=True)
    topic = db.Column(db.String(50), nullable=False, server_default='')
    date_shared = db.Column(db.DateTime,
                            nullable=False,
                            server_default='1900-01-01 00:00:00')
    share_level = db.Column(db.Char(2), nullable=False, server_default='')
    usergroup = db.relationship(Usergroup, backref='usergroup_baskets')
    usergroup_basket = db.relationship(BskBASKET, backref='usergroups')
Пример #28
0
class RnkPAGEVIEWS(db.Model):
    """Represents a RnkPAGEVIEWS record."""
    __tablename__ = 'rnkPAGEVIEWS'
    id = db.Column(db.MediumInteger,
                   primary_key=True,
                   nullable=False,
                   autoincrement=True)
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          nullable=True,
                          primary_key=True)
    id_user = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(User.id),
                        server_default='0',
                        primary_key=True)
    client_host = db.Column(db.Integer(10, unsigned=True), nullable=True)
    view_time = db.Column(db.DateTime,
                          primary_key=True,
                          server_default='1900-01-01 00:00:00')
    bibrec = db.relationship(Bibrec, backref='pageviews')
    user = db.relationship(User, backref='pageviews')
Пример #29
0
class HstBATCHUPLOAD(db.Model):
    """Represents a HstBATCHUPLOAD record."""
    __tablename__ = 'hstBATCHUPLOAD'
    id = db.Column(db.Integer(15, unsigned=True), nullable=False,
                primary_key=True, autoincrement=True)
    user = db.Column(db.String(50), nullable=False, index=True)
    submitdate = db.Column(db.DateTime, nullable=False)
    filename = db.Column(db.String(255), nullable=False)
    execdate = db.Column(db.DateTime, nullable=False)
    id_schTASK = db.Column(db.Integer(15, unsigned=True),
                db.ForeignKey(SchTASK.id), nullable=False)
    batch_mode = db.Column(db.String(15), nullable=False)
    task = db.relationship(SchTASK, backref='batchuploads')
Пример #30
0
class RnkWORD01R(db.Model):
    """Represents a RnkWORD01R record."""
    __tablename__ = 'rnkWORD01R'
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          nullable=False,
                          primary_key=True)
    termlist = db.Column(db.LargeBinary, nullable=True)
    type = db.Column(db.Enum('CURRENT', 'FUTURE', 'TEMPORARY'),
                     nullable=False,
                     server_default='CURRENT',
                     primary_key=True)
    bibrec = db.relationship(Bibrec, backref='word01rs')