Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dEdBoardRecom = db.Column(db.DateTime, nullable=False,
server_default='1900-01-01 00:00:00')
dPubComRecom = db.Column(db.DateTime, nullable=False,
server_default='1900-01-01 00:00:00')
dProjectLeaderAction = db.Column(db.DateTime, nullable=False,
server_default='1900-01-01 00:00:00')
class SbmFIELD(db.Model):
"""Represents a SbmFIELD record."""
__tablename__ = 'sbmFIELD'
subname = db.Column(db.String(13), nullable=True,
primary_key=True)
pagenb = db.Column(db.Integer(11), nullable=True,
primary_key=True, autoincrement=False)
fieldnb = db.Column(db.Integer(11), nullable=True)
fidesc = db.Column(db.String(15), nullable=True,
primary_key=True)
fitext = db.Column(db.Text, nullable=True)
level = db.Column(db.Char(1), nullable=True)
sdesc = db.Column(db.Text, nullable=True)
checkn = db.Column(db.Text, nullable=True)
cd = db.Column(db.Date, nullable=True)
md = db.Column(db.Date, nullable=True)
fiefi1 = db.Column(db.Text, nullable=True)
fiefi2 = db.Column(db.Text, nullable=True)
class SbmFIELDDESC(db.Model):
"""Represents a SbmFIELDDESC record."""
__tablename__ = 'sbmFIELDDESC'
name = db.Column(db.String(15), #db.ForeignKey(SbmFIELD.fidesc),
server_default='1900-01-01 00:00:00')
dEdiRec = db.Column(db.DateTime, nullable=False,
server_default='1900-01-01 00:00:00')
accessspo = db.Column(db.String(20), nullable=False, server_default='')
journal = db.Column(db.String(100), nullable=True)
class SbmPUBLICATIONCOMM(db.Model):
"""Represents a SbmPUBLICATIONCOMM record."""
__tablename__ = 'sbmPUBLICATIONCOMM'
id = db.Column(db.Integer(11), nullable=False,
primary_key=True, autoincrement=True)
id_parent = db.Column(db.Integer(11), server_default='0', nullable=True)
rn = db.Column(db.String(100), nullable=False, server_default='')
firstname = db.Column(db.String(100), nullable=True)
secondname = db.Column(db.String(100), nullable=True)
email = db.Column(db.String(100), nullable=True)
date = db.Column(db.String(40), nullable=False, server_default='')
synopsis = db.Column(db.String(255), nullable=False, server_default='')
commentfulltext = db.Column(db.Text, nullable=True)
class SbmPUBLICATIONDATA(db.Model):
"""Represents a SbmPUBLICATIONDATA record."""
__tablename__ = 'sbmPUBLICATIONDATA'
doctype = db.Column(db.String(10), nullable=False,
server_default='', primary_key=True)
editoboard = db.Column(db.String(250), nullable=False, server_default='')
base = db.Column(db.String(10), nullable=False, server_default='')
logicalbase = db.Column(db.String(10), nullable=False, server_default='')
spokesperson = db.Column(db.String(50), nullable=False, server_default='')
return True if self.email else False
def is_active(self):
"""Return True if use is active."""
return self.note != "0"
class UserEXT(db.Model):
"""Represent a UserEXT record."""
__tablename__ = 'userEXT'
id = db.Column(db.String(255), primary_key=True, nullable=False)
method = db.Column(db.String(50), primary_key=True, nullable=False)
id_user = db.Column(db.Integer(15, unsigned=True),
db.ForeignKey(User.id), nullable=False)
user = db.relationship(User, backref="external_identifiers")
__table_args__ = (db.Index('id_user', id_user, method, unique=True),
db.Model.__table_args__)
__all__ = ('User', 'UserEXT')
server_default='1900-01-01 00:00:00')
class SbmFIELD(db.Model):
"""Represents a SbmFIELD record."""
__tablename__ = 'sbmFIELD'
subname = db.Column(db.String(13), nullable=True,
primary_key=True)
pagenb = db.Column(db.Integer(11), nullable=True,
primary_key=True, autoincrement=False)
fieldnb = db.Column(db.Integer(11), nullable=True)
fidesc = db.Column(db.String(15), nullable=True,
primary_key=True)
fitext = db.Column(db.Text, nullable=True)
level = db.Column(db.Char(1), nullable=True)
sdesc = db.Column(db.Text, nullable=True)
checkn = db.Column(db.Text, nullable=True)
cd = db.Column(db.Date, nullable=True)
md = db.Column(db.Date, nullable=True)
fiefi1 = db.Column(db.Text, nullable=True)
fiefi2 = db.Column(db.Text, nullable=True)
class SbmFIELDDESC(db.Model):
"""Represents a SbmFIELDDESC record."""
__tablename__ = 'sbmFIELDDESC'
name = db.Column(db.String(15), #db.ForeignKey(SbmFIELD.fidesc),
nullable=False, server_default='', primary_key=True)
alephcode = db.Column(db.String(50), nullable=True)
marccode = db.Column(db.String(50), nullable=False, server_default='')
type = db.Column(db.Char(1), nullable=True)
size = db.Column(db.Integer(11), nullable=True)
from invenio.modules.accounts.models import User
from invenio.modules.records.models import Record as Bibrec
class SwrREMOTESERVER(db.Model):
"""Represents a SwrREMOTESERVER record."""
def __init__(self):
pass
__tablename__ = 'swrREMOTESERVER'
id = db.Column(db.Integer(15, unsigned=True), nullable=False,
primary_key=True, autoincrement=True)
name = db.Column(db.String(50), nullable=False, unique=True)
host = db.Column(db.String(50), nullable=False)
username = db.Column(db.String(50), nullable=False)
password = db.Column(db.String(50), nullable=False)
email = db.Column(db.String(50), nullable=False)
realm = db.Column(db.String(50), nullable=False)
url_base_record = db.Column(db.String(50), nullable=False)
url_servicedocument = db.Column(db.String(80),
nullable=False)
xml_servicedocument = db.Column(db.LargeBinary,
nullable=True)
last_update = db.Column(db.Integer(15, unsigned=True),
nullable=False)
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,
last_version = db.Column(db.Boolean, nullable=False, index=True)
cd = db.Column(db.DateTime, nullable=False, index=True)
md = db.Column(db.DateTime, nullable=False, index=True)
checksum = db.Column(db.Char(32), nullable=False)
filesize = db.Column(db.BigInteger(15, unsigned=True), nullable=False,
index=True)
mime = db.Column(db.String(100), nullable=False, index=True)
master_format = db.Column(db.String(50))
class Bibdocmoreinfo(db.Model):
"""Represents a Bibdocmoreinfo record."""
__tablename__ = 'bibdocmoreinfo'
id = db.Column(db.MediumInteger(9, unsigned=True), primary_key=True)
id_bibdoc = db.Column(db.MediumInteger(9, unsigned=True),
db.ForeignKey(Bibdoc.id), nullable=True)
version = db.Column(db.TinyInteger(4, unsigned=True), nullable=True)
format = db.Column(db.String(50), nullable=True)
id_rel = db.Column(db.MediumInteger(9, unsigned=True), nullable=True)
namespace = db.Column(db.Char(25), nullable=True)
data_key = db.Column(db.Char(25))
data_value = db.Column(db.LargeBinary)
__table_args__ = (db.Index('bibdocmoreinfo_key', id_bibdoc, version,
format, id_rel, namespace, data_key),
db.Model.__table_args__)
class Document(db.Model):
"""Represents a document object inside the SQL database"""
# along with Invenio; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
"""
websubmit database models.
"""
# General imports.
from invenio.ext.sqlalchemy import db
# Create your models here.
class SbmACTION(db.Model):
"""Represents a SbmACTION record."""
__tablename__ = 'sbmACTION'
lactname = db.Column(db.Text, nullable=True)
sactname = db.Column(db.Char(3), nullable=False, server_default='',
primary_key=True)
dir = db.Column(db.Text, nullable=True)
cd = db.Column(db.Date, nullable=True)
md = db.Column(db.Date, nullable=True)
actionbutton = db.Column(db.Text, nullable=True)
statustext = db.Column(db.Text, nullable=True)
class SbmALLFUNCDESCR(db.Model):
"""Represents a SbmALLFUNCDESCR record."""
__tablename__ = 'sbmALLFUNCDESCR'
#FIX ME pk
function = db.Column(db.String(40), nullable=False, server_default='',
primary_key=True)
description = db.Column(db.TinyText, nullable=True)
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=True)
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,
step = db.Column(db.TinyInteger(4), nullable=False,
server_default='1', primary_key=True)
class SbmFUNDESC(db.Model):
"""Represents a SbmFUNDESC record."""
__tablename__ = 'sbmFUNDESC'
function = db.Column(db.String(40), nullable=False,
server_default='', primary_key=True)
param = db.Column(db.String(40), primary_key=True)
class SbmGFILERESULT(db.Model):
"""Represents a SbmGFILERESULT record."""
__tablename__ = 'sbmGFILERESULT'
FORMAT = db.Column(db.Text(50), nullable=False,
primary_key=True)
RESULT = db.Column(db.Text(50), nullable=False,
primary_key=True)
class SbmIMPLEMENT(db.Model):
"""Represents a SbmIMPLEMENT record."""
__tablename__ = 'sbmIMPLEMENT'
docname = db.Column(db.String(10), nullable=True)
actname = db.Column(db.Char(3), nullable=True)
displayed = db.Column(db.Char(1), nullable=True)
subname = db.Column(db.String(13), nullable=True, primary_key=True)
nbpg = db.Column(db.Integer(11), nullable=True, primary_key=True,
autoincrement=False)
cd = db.Column(db.Date, nullable=True)
md = db.Column(db.Date, nullable=True)
buttonorder = db.Column(db.Integer(11), nullable=True)
statustext = db.Column(db.Text, nullable=True)
level = db.Column(db.Char(1), nullable=False, server_default='')
# Create your models here.
from invenio.modules.records.models import Record as Bibrec
class BibHOLDINGPEN(db.Model):
"""Represents a BibHOLDINGPEN record."""
def __init__(self):
pass
__tablename__ = 'bibHOLDINGPEN'
changeset_id = db.Column(db.Integer(11), primary_key=True,
autoincrement=True)
changeset_date = db.Column(db.DateTime, nullable=False,
server_default='1900-01-01 00:00:00', index=True)
changeset_xml = db.Column(db.Text, nullable=False)
oai_id = db.Column(db.String(40), nullable=False,
server_default='')
id_bibrec = db.Column(db.MediumInteger(8, unsigned=True),
db.ForeignKey(Bibrec.id), nullable=False, server_default='0')
bibrec = db.relationship(Bibrec, backref='holdingpen')
class Bibdoc(db.Model):
"""Represents a Bibdoc record."""
__tablename__ = 'bibdoc'
id = db.Column(db.MediumInteger(9, unsigned=True), primary_key=True,
nullable=False, autoincrement=True)
status = db.Column(db.Text, nullable=False)
docname = db.Column(db.String(250), nullable=True, # collation='utf8_bin'
index=True)
creation_date = db.Column(db.DateTime, nullable=False,
server_default='1900-01-01 00:00:00', index=True)