How to use the invenio.ext.sqlalchemy.db.Model function in invenio

To help you get started, we’ve selected a few invenio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inveniosoftware / invenio / invenio / modules / ranker / models.py View on Github external
authorid = db.Column(db.BigInteger(10), primary_key=True, nullable=False)


class RnkSELFCITES(db.Model):

    """Represent a RnkSELFCITES record."""

    __tablename__ = 'rnkSELFCITES'
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                          db.ForeignKey(Bibrec.id), nullable=True,
                          primary_key=True)
    count = db.Column(db.Integer(10, unsigned=True), nullable=False)
    references = db.Column(db.Text, nullable=False)
    last_updated = db.Column(db.DateTime, nullable=False)

class RnkSELFCITEDICT(db.Model):

    """Represents a RnkSELFCITEDICT record."""

    __tablename__ = 'rnkSELFCITEDICT'
    citee = db.Column(db.Integer(10, unsigned=True), nullable=False,
                      primary_key=True, autoincrement=False)
    citer = db.Column(db.Integer(10, unsigned=True), nullable=False,
                      primary_key=True, autoincrement=False)
    last_updated = db.Column(db.DateTime, nullable=False)
    __table_args__ = (db.Index('rnkSELFCITEDICT_reverse', citer, citee),
                      db.Model.__table_args__)


class CollectionRnkMETHOD(db.Model):

    """Represent a CollectionRnkMETHOD record."""
github inveniosoftware / invenio / invenio / modules / sorter / models.py View on Github external
last_updated = db.Column(db.DateTime)

    method = db.relationship(BsrMETHOD, backref=db.backref(
        "buckets",
        collection_class=attribute_mapped_collection("bucket_no"),
        cascade="all, delete-orphan"
        )
    )

    @property
    def data(self):
        """Return bucket data as intbitset."""
        return intbitset(self.bucket_data)


class BsrMETHODNAME(db.Model):

    """Represent a BsrMETHODNAME record."""

    __tablename__ = 'bsrMETHODNAME'

    id_bsrMETHOD = db.Column(db.MediumInteger(9, unsigned=True),
                             db.ForeignKey(BsrMETHOD.id),
                             primary_key=True, nullable=False,
                             autoincrement=False)
    ln = db.Column(db.String(5), primary_key=True, nullable=False)
    type = db.Column(db.String(3), primary_key=True, nullable=False)
    value = db.Column(db.String(255), nullable=False)
    method = db.relationship(BsrMETHOD, backref=db.backref('names',
                                                           lazy='dynamic'))
github inveniosoftware / invenio / invenio / modules / editor / models.py View on Github external
bibxxx = db.relationship(Bib16x, backref='bibrecs')

class Bib17x(db.Model):
    """Represents a Bib17x record."""
    def __init__(self):
        pass
    __tablename__ = 'bib17x'
    id = db.Column(db.MediumInteger(8, unsigned=True),
                primary_key=True,
                autoincrement=True)
    tag = db.Column(db.String(6), nullable=False, index=True,
                server_default='')
    value = db.Column(db.Text(35), nullable=False,
                index=True)

class BibrecBib17x(db.Model):
    """Represents a BibrecBib17x record."""
    def __init__(self):
        pass
    __tablename__ = 'bibrec_bib17x'
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bibrec.id),
        nullable=False, primary_key=True, index=True,
                server_default='0')
    id_bibxxx = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bib17x.id),
        nullable=False, primary_key=True, index=True,
                server_default='0')
    field_number = db.Column(db.SmallInteger(5, unsigned=True),
                primary_key=True)
    bibrec = db.relationship(Bibrec, backref='bib17xs')
    bibxxx = db.relationship(Bib17x, backref='bibrecs')
github inveniosoftware / invenio / invenio / modules / exporter / models.py View on Github external
id = db.Column(db.Integer(15, unsigned=True), nullable=False,
                primary_key=True,
                autoincrement=True)
    id_expQUERY = db.Column(db.Integer(15, unsigned=True),
                db.ForeignKey(ExpQUERY.id),
                nullable=False)
    result = db.Column(db.Text, nullable=False)
    status = db.Column(db.MediumInteger(12), nullable=False,
                server_default='0')
    status_message = db.Column(db.Text, nullable=False)
    query = db.relationship(ExpQUERY, backref='queryresults')
#    jobresults = db.relationship(ExpJOBRESULT,
#            secondary=expJOBRESULT_expQUERYRESULT,
#            backref='queryresults')

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)



__all__ = ['ExpJOB',
           'UserExpJOB',
           'ExpJOBRESULT',
           'ExpQUERY',
           'ExpQUERYRESULT',
github inveniosoftware / invenio / invenio / modules / editor / models.py View on Github external
pass
    __tablename__ = 'bibrec_bib89x'
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bibrec.id),
        nullable=False, primary_key=True, index=True,
                server_default='0')
    id_bibxxx = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bib89x.id),
        nullable=False, primary_key=True, index=True,
                server_default='0')
    field_number = db.Column(db.SmallInteger(5, unsigned=True),
                primary_key=True)
    bibrec = db.relationship(Bibrec, backref='bib89xs')
    bibxxx = db.relationship(Bib89x, backref='bibrecs')

class Bib90x(db.Model):
    """Represents a Bib90x record."""
    def __init__(self):
        pass
    __tablename__ = 'bib90x'
    id = db.Column(db.MediumInteger(8, unsigned=True),
                primary_key=True,
                autoincrement=True)
    tag = db.Column(db.String(6), nullable=False, index=True,
                server_default='')
    value = db.Column(db.Text(35), nullable=False,
                index=True)

class BibrecBib90x(db.Model):
    """Represents a BibrecBib90x record."""
    def __init__(self):
        pass
github inveniosoftware / invenio / invenio / modules / editor / models.py View on Github external
pass
    __tablename__ = 'bibrec_bib95x'
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bibrec.id),
        nullable=False, primary_key=True, index=True,
                server_default='0')
    id_bibxxx = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bib95x.id),
        nullable=False, primary_key=True, index=True,
                server_default='0')
    field_number = db.Column(db.SmallInteger(5, unsigned=True),
                primary_key=True)
    bibrec = db.relationship(Bibrec, backref='bib95xs')
    bibxxx = db.relationship(Bib95x, backref='bibrecs')

class Bib96x(db.Model):
    """Represents a Bib96x record."""
    def __init__(self):
        pass
    __tablename__ = 'bib96x'
    id = db.Column(db.MediumInteger(8, unsigned=True),
                primary_key=True,
                autoincrement=True)
    tag = db.Column(db.String(6), nullable=False, index=True,
                server_default='')
    value = db.Column(db.Text(35), nullable=False,
                index=True)

class BibrecBib96x(db.Model):
    """Represents a BibrecBib96x record."""
    def __init__(self):
        pass
github inveniosoftware / invenio / invenio / modules / editor / models.py View on Github external
pass
    __tablename__ = 'bibrec_bib41x'
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bibrec.id),
        nullable=False, primary_key=True, index=True,
                server_default='0')
    id_bibxxx = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bib41x.id),
        nullable=False, primary_key=True, index=True,
                server_default='0')
    field_number = db.Column(db.SmallInteger(5, unsigned=True),
                primary_key=True)
    bibrec = db.relationship(Bibrec, backref='bib41xs')
    bibxxx = db.relationship(Bib41x, backref='bibrecs')

class Bib42x(db.Model):
    """Represents a Bib42x record."""
    def __init__(self):
        pass
    __tablename__ = 'bib42x'
    id = db.Column(db.MediumInteger(8, unsigned=True),
                primary_key=True,
                autoincrement=True)
    tag = db.Column(db.String(6), nullable=False, index=True,
                server_default='')
    value = db.Column(db.Text(35), nullable=False,
                index=True)

class BibrecBib42x(db.Model):
    """Represents a BibrecBib42x record."""
    def __init__(self):
        pass
github inveniosoftware / invenio / invenio / modules / ranker / models.py View on Github external
class RnkMETHODNAME(db.Model):

    """Represent 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=db.backref('names',
                                                           lazy='dynamic'))


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__)

class RnkCITATIONDATAERR(db.Model):

    """Represent a RnkCITATIONDATAERR record."""

    __tablename__ = 'rnkCITATIONDATAERR'
    type = db.Column(db.Enum('multiple-matches', 'not-well-formed',
github inveniosoftware / invenio / invenio / modules / editor / models.py View on Github external
pass
    __tablename__ = 'bibrec_bib98x'
    id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bibrec.id),
        nullable=False, primary_key=True, index=True,
                server_default='0')
    id_bibxxx = db.Column(db.MediumInteger(8, unsigned=True),
                db.ForeignKey(Bib98x.id),
        nullable=False, primary_key=True, index=True,
                server_default='0')
    field_number = db.Column(db.SmallInteger(5, unsigned=True),
                primary_key=True)
    bibrec = db.relationship(Bibrec, backref='bib98xs')
    bibxxx = db.relationship(Bib98x, backref='bibrecs')

class Bib99x(db.Model):
    """Represents a Bib99x record."""
    def __init__(self):
        pass
    __tablename__ = 'bib99x'
    id = db.Column(db.MediumInteger(8, unsigned=True),
                primary_key=True,
                autoincrement=True)
    tag = db.Column(db.String(6), nullable=False, index=True,
                server_default='')
    value = db.Column(db.Text(35), nullable=False,
                index=True)

class BibrecBib99x(db.Model):
    """Represents a BibrecBib99x record."""
    def __init__(self):
        pass
github EUDAT-B2SHARE / b2share / invenio / modules / search / models.py View on Github external
def get_pbx_pos():
    """Returns a list of all the positions for a portalbox"""

    position = {}
    position["rt"] = "Right Top"
    position["lt"] = "Left Top"
    position["te"] = "Title Epilog"
    position["tp"] = "Title Prolog"
    position["ne"] = "Narrow by coll epilog"
    position["np"] = "Narrow by coll prolog"
    return position


class CollectionPortalbox(db.Model):
    """Represents a CollectionPortalbox record."""
    __tablename__ = 'collection_portalbox'
    id_collection = db.Column(db.MediumInteger(9, unsigned=True),
                db.ForeignKey(Collection.id), primary_key=True)
    id_portalbox = db.Column(db.MediumInteger(9, unsigned=True),
                db.ForeignKey(Portalbox.id), primary_key=True)
    ln = db.Column(db.Char(5), primary_key=True, server_default='',
                nullable=False)
    position = db.Column(db.Char(3), nullable=False,
                server_default='top')
    score = db.Column(db.TinyInteger(4, unsigned=True),
                nullable=False,
            server_default='0')
    collection = db.relationship(Collection, backref='portalboxes',
                order_by=score)
    portalbox = db.relationship(Portalbox, backref='collections',