Beispiel #1
0
class CrcITEM(db.Model):
    """Represents a CrcITEM record."""
    def __init__(self):
        pass

    __tablename__ = 'crcITEM'
    barcode = db.Column(db.String(30),
                        nullable=False,
                        server_default='',
                        primary_key=True)
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          nullable=False,
                          server_default='0')
    id_crcLIBRARY = db.Column(db.Integer(15, unsigned=True),
                              db.ForeignKey(CrcLIBRARY.id),
                              nullable=False,
                              server_default='0')
    collection = db.Column(db.String(60), nullable=True)
    location = db.Column(db.String(60), nullable=True)
    description = db.Column(db.String(60), nullable=True)
    loan_period = db.Column(db.String(30), nullable=False, server_default='')
    status = db.Column(db.String(20), nullable=False, server_default='')
    expected_arrival_date = db.Column(db.String(60),
                                      nullable=False,
                                      server_default='')
    creation_date = db.Column(db.DateTime,
                              nullable=False,
                              server_default='1900-01-01 00:00:00')
    modification_date = db.Column(db.DateTime,
                                  nullable=False,
                                  server_default='1900-01-01 00:00:00')
    number_of_requests = db.Column(db.Integer(3, unsigned=True),
                                   nullable=False,
                                   server_default='0')
Beispiel #2
0
class CrcBORROWER(db.Model):
    """Represents a CrcBORROWER record."""
    def __init__(self):
        pass

    __tablename__ = 'crcBORROWER'
    id = db.Column(db.Integer(15, unsigned=True),
                   nullable=False,
                   primary_key=True,
                   autoincrement=True)
    ccid = db.Column(db.Integer(15, unsigned=True),
                     nullable=True,
                     unique=True,
                     server_default=None)
    name = db.Column(db.String(255),
                     nullable=False,
                     server_default='',
                     index=True)
    email = db.Column(db.String(255),
                      nullable=False,
                      server_default='',
                      index=True)
    phone = db.Column(db.String(60), nullable=True)
    address = db.Column(db.String(60), nullable=True)
    mailbox = db.Column(db.String(30), nullable=True)
    borrower_since = db.Column(db.DateTime,
                               nullable=False,
                               server_default='1900-01-01 00:00:00')
    borrower_until = db.Column(db.DateTime,
                               nullable=False,
                               server_default='1900-01-01 00:00:00')
    notes = db.Column(db.Text, nullable=True)
Beispiel #3
0
class NwsToolTip(db.Model):
    """Represents a NwsToolTip record."""
    __tablename__ = 'nwsTOOLTIP'
    id = db.Column(db.Integer(15, unsigned=True), nullable=False, primary_key=True,autoincrement=True)
    id_story = db.Column(db.Integer(15, unsigned=True), db.ForeignKey('nwsSTORY.id'))
    body = db.Column(db.String(512), nullable=False, server_default='0')
    target_element = db.Column(db.String(256), nullable=False,server_default='0')
    target_page = db.Column(db.String(256), nullable=False)


    @property
    def serialize(self):
       """Return object data in easily serializeable format"""
       return {
           'id'         : self.id,
           'id_story': self.id_story,
           'body': self.body,
           'target_element': self.target_element,
           'target_page': self.target_page

       }
    @property
    def serialize_many2many(self):
       """
       Return object's relations in easily serializeable format.
       NB! Calls many2many's serialize property.
       """
       return [ item.serialize for item in self.nwsSTORY]
Beispiel #4
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')
class nwsTOOLTIP(db.Model):
    """
    CREATE TABLE 'nwsTOOLTIP' (
     'id' int(11) NOT NULL AUTO_INCREMENT,
     'id_story' int(11) NOT NULL,
     'body' varchar(512) NOT NULL,
     'target_element' varchar(256) NOT NULL DEFAULT '',
     'target_page' varchar(256) NOT NULL DEFAULT '',
     PRIMARY KEY ('id'),
     KEY 'id_story' ('id_story'),
     CONSTRAINT 'nwsTOOLTIP_ibfk_1' FOREIGN KEY ('id_story') REFERENCES 'nwsSTORY' ('id')
    );
    """
    __tablename__ = 'nwsTOOLTIP'

    id = db.Column(db.Integer(11),
                   nullable=False,
                   primary_key=True,
                   autoincrement=True)
    id_story = db.Column(db.Integer(11), db.ForeignKey(nwsSTORY.id))
    body = db.Column(db.String(512), nullable=False)
    target_element = db.Column(db.String(256), nullable=False, default='')
    target_page = db.Column(db.String(256), nullable=False, default='')

    idstory = db.relationship('nwsSTORY', foreign_keys='nwsTOOLTIP.id_story')
Beispiel #6
0
def do_upgrade():
    """Upgrades."""
    op.add_column(
        u'pages', db.Column('description',
                            db.String(length=200),
                            nullable=True))
    op.create_table('pagesLIST',
                    db.Column('id',
                              db.Integer(15, unsigned=True),
                              nullable=False),
                    db.Column('list_id',
                              db.Integer(15, unsigned=True),
                              nullable=False),
                    db.Column('page_id',
                              db.Integer(15, unsigned=True),
                              nullable=False),
                    db.Column('order',
                              db.Integer(15, unsigned=True),
                              nullable=False),
                    db.PrimaryKeyConstraint('id'),
                    db.ForeignKeyConstraint(
                        ['list_id'],
                        [u'pages.id'],
                    ),
                    db.ForeignKeyConstraint(
                        ['page_id'],
                        [u'pages.id'],
                    ),
                    mysql_charset='utf8',
                    mysql_engine='MyISAM')
Beispiel #7
0
class PidLog(db.Model):

    """Audit log of actions happening to persistent identifiers.

    This model is primarily used through PersistentIdentifier.log and rarely
    created manually.
    """

    __tablename__ = 'pidLOG'
    __table_args__ = (
        db.Index('idx_action', 'action'),
    )

    id = db.Column(db.Integer(15, unsigned=True), primary_key=True)
    """Id of persistent identifier entry."""

    id_pid = db.Column(
        db.Integer(15, unsigned=True), db.ForeignKey(PersistentIdentifier.id),
        nullable=True,
    )
    """PID."""

    timestamp = db.Column(db.DateTime(), nullable=False, default=datetime.now)
    """Creation datetime of entry."""

    action = db.Column(db.String(10), nullable=False)
    """Action identifier."""

    message = db.Column(db.Text(), nullable=False)
    """Log message."""

    # Relationship
    pid = db.relationship("PersistentIdentifier", backref="logs")
Beispiel #8
0
class BskREC(db.Model):
    """Represents a BskREC record."""

    __tablename__ = 'bskREC'
    id_bibrec_or_bskEXTREC = db.Column(db.Integer(16),
                                       nullable=False,
                                       server_default='0',
                                       primary_key=True,
                                       index=True)
    id_bskBASKET = db.Column(db.Integer(15, unsigned=True),
                             db.ForeignKey(BskBASKET.id),
                             nullable=False,
                             server_default='0',
                             primary_key=True)
    id_user_who_added_item = db.Column(db.Integer(15, unsigned=True),
                                       db.ForeignKey(User.id),
                                       nullable=False,
                                       server_default='0')
    score = db.Column(db.Integer(15), nullable=False, server_default='0')
    date_added = db.Column(db.DateTime,
                           nullable=False,
                           index=True,
                           server_default='1900-01-01 00:00:00')
    basket = db.relationship(BskBASKET, backref='RECs')
    user_who_added_item = db.relationship(User)
Beispiel #9
0
class AccAuthorization(db.Model):
    """Represent an authorization."""

    __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),
                               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')
Beispiel #10
0
class UserQuery(db.Model):
    """Represent a UserQuery record."""

    __tablename__ = 'user_query'
    id_user = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(User.id),
                        primary_key=True,
                        server_default='0')
    id_query = db.Column(db.Integer(15, unsigned=True),
                         db.ForeignKey(WebQuery.id),
                         primary_key=True,
                         index=True,
                         server_default='0')
    hostname = db.Column(db.String(50),
                         nullable=True,
                         server_default='unknown host')
    date = db.Column(db.DateTime, nullable=True, default=datetime.datetime.now)

    webquery = db.relationship(WebQuery, backref='executions')

    @classmethod
    def log(cls, urlargs=None, id_user=None):
        """Log."""
        id_user = id_user if not None else current_user.get_id()
        urlargs = urlargs or request.query_string
        if id_user < 0:
            return
        webquery = WebQuery.query.filter_by(urlargs=urlargs).first()
        if webquery is None:
            webquery = WebQuery(urlargs=urlargs)
        db.session.add(
            cls(id_user=id_user, hostname=request.host, webquery=webquery))
        db.session.commit()
Beispiel #11
0
class RnkDOWNLOADS(db.Model):
    """Represent 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')
Beispiel #12
0
class SbmCOLLECTIONSbmDOCTYPE(db.Model):
    """Represents a SbmCOLLECTIONSbmDOCTYPE record."""

    __tablename__ = 'sbmCOLLECTION_sbmDOCTYPE'
    id = db.Column(db.Integer(11),
                   nullable=False,
                   autoincrement=True,
                   primary_key=True)
    _id_father = db.Column(db.Integer(11),
                           db.ForeignKey(SbmCOLLECTION.id),
                           nullable=True,
                           name="id_father")
    id_son = db.Column(db.Char(10),
                       db.ForeignKey(SbmDOCTYPE.sdocname),
                       nullable=False)
    catalogue_order = db.Column(db.Integer(11),
                                nullable=False,
                                server_default='0')

    father = db.relationship(
        SbmCOLLECTION,
        backref=db.backref('sonDoctype', uselist=False),
    )

    @db.hybrid_property
    def id_father(self):
        """Get id_father."""
        return self._id_father

    @id_father.setter
    def id_father(self, value):
        """Set id_father."""
        self._id_father = value or None
def do_upgrade():
    """ Implement your upgrades here  """
    if not op.has_table('remoteACCOUNT'):
        op.create_table(
            'remoteACCOUNT',
            db.Column('id', db.Integer(display_width=15), nullable=False),
            db.Column('user_id', db.Integer(display_width=15), nullable=False),
            db.Column('client_id', db.String(length=255), nullable=False),
            db.Column('extra_data', db.JSON, nullable=True),
            db.ForeignKeyConstraint(['user_id'], ['user.id'], ),
            db.PrimaryKeyConstraint('id'),
            db.UniqueConstraint('user_id', 'client_id'),
            mysql_charset='utf8',
            mysql_engine='MyISAM'
        )
    else:
        warnings.warn("*** Creation of table 'remoteACCOUNT table skipped!'")

    if not op.has_table('remoteTOKEN'):
        op.create_table(
            'remoteTOKEN',
            db.Column('id_remote_account', db.Integer(display_width=15),
                    nullable=False),
            db.Column('token_type', db.String(length=40), nullable=False),
            db.Column('access_token', db.Text(), nullable=False),
            db.Column('secret', db.Text(), nullable=False),
            db.ForeignKeyConstraint(['id_remote_account'],
                                    ['remoteACCOUNT.id'], ),
            db.PrimaryKeyConstraint('id_remote_account', 'token_type'),
            mysql_charset='utf8',
            mysql_engine='MyISAM'
        )
    else:
        warnings.warn("*** Creation of table 'remoteTOKEN' skipped!'")
Beispiel #14
0
class AccAuthorization(db.Model):
    """Represent an authorization."""

    __tablename__ = 'accROLE_accACTION_accARGUMENT'
    id = db.Column(db.Integer(15, unsigned=True),
                   primary_key=True,
                   autoincrement=True)
    id_accROLE = db.Column(db.Integer(15, unsigned=True),
                           db.ForeignKey(AccROLE.id),
                           nullable=True,
                           index=True)
    id_accACTION = db.Column(db.Integer(15, unsigned=True),
                             db.ForeignKey(AccACTION.id),
                             nullable=True,
                             index=True)
    _id_accARGUMENT = db.Column(db.Integer(15),
                                db.ForeignKey(AccARGUMENT.id),
                                nullable=True,
                                name="id_accARGUMENT",
                                index=True)
    argumentlistid = db.Column(db.MediumInteger(8), nullable=True)

    role = db.relationship(AccROLE, backref='authorizations')
    action = db.relationship(AccACTION, backref='authorizations')
    argument = db.relationship(AccARGUMENT, backref='authorizations')

    @db.hybrid_property
    def id_accARGUMENT(self):
        """get id_accARGUMENT."""
        return self._id_accARGUMENT

    @id_accARGUMENT.setter
    def id_accARGUMENT(self, value):
        """set id_accARGUMENT."""
        self._id_accARGUMENT = value or None
Beispiel #15
0
class CmtNOTECOLLAPSED(db.Model):
    """Represents a CmtNOTECOLLAPSED record."""

    __tablename__ = 'cmtNOTECOLLAPSED'

    id = \
        db.Column(db.Integer(15, unsigned=True),
                  primary_key=True,
                  autoincrement=True,
                  nullable=False,
                  unique=True)

    id_bibrec = \
        db.Column(db.MediumInteger(8, unsigned=True),
                  db.ForeignKey(Bibrec.id),
                  primary_key=False,
                  nullable=False,
                  unique=False)

    # e.g., P1-F2 is the path for a note on Page 1, Figure 2
    path = \
        db.Column(db.Text,
                  primary_key=False,
                  nullable=False,
                  unique=False)

    id_user = \
        db.Column(db.Integer(15, unsigned=True),
                  db.ForeignKey(User.id),
                  primary_key=False,
                  nullable=False,
                  unique=False)
def do_upgrade():
    op.alter_column(u'schTASK',
                    'sequenceid',
                    type_=db.Integer(display_width=15, unsigned=True))
    op.alter_column(u'hstTASK',
                    'sequenceid',
                    type_=db.Integer(display_width=15, unsigned=True))
Beispiel #17
0
class PageList(db.Model):
    """Represent association between page and list."""
    __tablename__ = 'pagesLIST'

    id = db.Column(db.Integer(15, unsigned=True),
                   nullable=False,
                   primary_key=True,
                   autoincrement=True)
    """PageList identifier."""

    list_id = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(Page.id),
                        nullable=False)
    """Id of a list."""

    page_id = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(Page.id),
                        nullable=False)
    """Id of a page."""

    order = db.Column(db.Integer(15, unsigned=True), nullable=False)

    list = db.relationship(Page,
                           backref=db.backref("pages",
                                              cascade="all, delete-orphan"),
                           foreign_keys=[list_id])
    """Relation to the list."""

    page = db.relationship(Page,
                           backref=db.backref("lists",
                                              cascade="all, delete-orphan"),
                           foreign_keys=[page_id])
    """Relation to the page."""
Beispiel #18
0
class RnkCITATIONDICT(db.Model):
    """Represent a RnkCITATIONDICT record."""

    __tablename__ = 'rnkCITATIONDICT'
    citee = db.Column(db.Integer(10, unsigned=True), primary_key=True)
    citer = db.Column(db.Integer(10, unsigned=True), primary_key=True)
    last_updated = db.Column(db.DateTime, nullable=False)
    __table_args__ = (db.Index('rnkCITATIONDICT_reverse', citer,
                               citee), db.Model.__table_args__)
Beispiel #19
0
def do_upgrade():
    """ Implement your upgrades here  """
    op.alter_column(
        u'schTASK', 'sequenceid',
        type_=db.Integer(display_width=15)
    )
    op.alter_column(
        u'hstTASK', 'sequenceid',
        type_=db.Integer(display_width=15)
    )
Beispiel #20
0
class SbmCOOKIES(db.Model):
    """Represents a SbmCOOKIES record."""
    __tablename__ = 'sbmCOOKIES'
    id = db.Column(db.Integer(15, unsigned=True),
                   nullable=False,
                   primary_key=True,
                   autoincrement=True)
    name = db.Column(db.String(100), nullable=False)
    value = db.Column(db.Text, nullable=True)
    uid = db.Column(db.Integer(15), nullable=False)
def do_upgrade():
    """ Implement your upgrades here  """
    op.add_column(u'community', db.Column('fixed_points',
                  db.Integer(display_width=9), nullable=False))
    op.add_column(u'community',
                  db.Column('last_record_accepted', db.DateTime(),
                            nullable=False))
    op.add_column(u'community',
                  db.Column('ranking', db.Integer(display_width=9),
                            nullable=False))
Beispiel #22
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')
Beispiel #23
0
class UserExpJOB(db.Model):
    """Represents a UserExpJOB record."""
    __tablename__ = 'user_expJOB'
    id_user = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(User.id),
                        nullable=False,
                        primary_key=True)
    id_expJOB = db.Column(db.Integer(15, unsigned=True),
                          db.ForeignKey(ExpJOB.id),
                          nullable=False,
                          primary_key=True)
Beispiel #24
0
class ExpJOBRESULTExpQUERYRESULT(db.Model):
    """Represents a ExpJOBRESULTExpQUERYRESULT record."""
    __tablename__ = 'expJOBRESULT_expQUERYRESULT'
    id_expJOBRESULT = db.Column(db.Integer(15, unsigned=True),
                                db.ForeignKey(ExpJOBRESULT.id),
                                nullable=False,
                                primary_key=True)
    id_expQUERYRESULT = db.Column(db.Integer(15, unsigned=True),
                                  db.ForeignKey(ExpQUERYRESULT.id),
                                  nullable=False,
                                  primary_key=True)
Beispiel #25
0
class LnkADMINURLLOG(db.Model):
    """Represents a LnkADMINURLLOG record."""
    __tablename__ = 'lnkADMINURLLOG'

    id_lnkADMINURL = db.Column(db.Integer(15, unsigned=True),
                               db.ForeignKey(LnkADMINURL.id),
                               primary_key=True,
                               nullable=False)
    id_lnkLOG = db.Column(db.Integer(15, unsigned=True),
                          db.ForeignKey(LnkLOG.id),
                          primary_key=True,
                          nullable=False)
Beispiel #26
0
class LnkLOG(db.Model):
    """Represents a LnkLOG record."""
    __tablename__ = 'lnkLOG'

    id = db.Column(db.Integer(15, unsigned=True),
                   primary_key=True,
                   nullable=False)
    id_user = db.Column(db.Integer(15, unsigned=True), db.ForeignKey(User.id))
    action = db.Column(db.String(30), nullable=False, index=True)
    log_time = db.Column(db.DateTime,
                         server_default='1900-01-01 00:00:00',
                         index=True)
Beispiel #27
0
class WtgTAGRecord(db.Model, Serializable):

    """Connection between Tag and Record."""

    __tablename__ = 'wtgTAG_bibrec'
    __public__ = set(['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)

    # Annotation
    annotation = db.Column(
        db.Text(convert_unicode=True),
        default='')

    # 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'))

    def __init__(self, bibrec=None, **kwargs):
        """TODO."""
        super(WtgTAGRecord, self).__init__(**kwargs)

        if bibrec is not None:
            self.bibrec = bibrec
Beispiel #28
0
class GroupInstrument(db.Model):
    __tablename__ = 'group_instrument'

    """ Fields """
    id = db.Column(db.Integer(255, unsigned=True),
                        nullable=False, primary_key=True,
                        )
    group_id = db.Column(db.Integer(255, unsigned=True), db.ForeignKey(Group.id),
                        nullable=False,
                        )
    instrument_id = db.Column(db.Integer(255, unsigned=True), db.ForeignKey(Instrument.id),
                        nullable=False,
                        )
Beispiel #29
0
class CmtCOLLAPSED(db.Model):
    """Represents a CmtCOLLAPSED record."""

    __tablename__ = 'cmtCOLLAPSED'

    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id),
                          primary_key=True)
    id_cmtRECORDCOMMENT = db.Column(db.Integer(15, unsigned=True),
                                    db.ForeignKey(CmtRECORDCOMMENT.id),
                                    primary_key=True)
    id_user = db.Column(db.Integer(15, unsigned=True),
                        db.ForeignKey(User.id),
                        primary_key=True)
Beispiel #30
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')