|
|
@ -67,9 +67,9 @@ class Identifiers(Base):
|
|
|
|
val = Column(String)
|
|
|
|
val = Column(String)
|
|
|
|
book = Column(Integer, ForeignKey('books.id'))
|
|
|
|
book = Column(Integer, ForeignKey('books.id'))
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, val, type, book):
|
|
|
|
def __init__(self, val, id_type, book):
|
|
|
|
self.val = val
|
|
|
|
self.val = val
|
|
|
|
self.type = type
|
|
|
|
self.type = id_type
|
|
|
|
self.book = book
|
|
|
|
self.book = book
|
|
|
|
|
|
|
|
|
|
|
|
def formatType(self):
|
|
|
|
def formatType(self):
|
|
|
@ -209,9 +209,9 @@ class Data(Base):
|
|
|
|
uncompressed_size = Column(Integer)
|
|
|
|
uncompressed_size = Column(Integer)
|
|
|
|
name = Column(String)
|
|
|
|
name = Column(String)
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, book, format, uncompressed_size, name):
|
|
|
|
def __init__(self, book, book_format, uncompressed_size, name):
|
|
|
|
self.book = book
|
|
|
|
self.book = book
|
|
|
|
self.format = format
|
|
|
|
self.format = book_format
|
|
|
|
self.uncompressed_size = uncompressed_size
|
|
|
|
self.uncompressed_size = uncompressed_size
|
|
|
|
self.name = name
|
|
|
|
self.name = name
|
|
|
|
|
|
|
|
|
|
|
@ -274,7 +274,7 @@ class Custom_Columns(Base):
|
|
|
|
display = Column(String)
|
|
|
|
display = Column(String)
|
|
|
|
is_multiple = Column(Boolean)
|
|
|
|
is_multiple = Column(Boolean)
|
|
|
|
normalized = Column(Boolean)
|
|
|
|
normalized = Column(Boolean)
|
|
|
|
|
|
|
|
|
|
|
|
def get_display_dict(self):
|
|
|
|
def get_display_dict(self):
|
|
|
|
display_dict = ast.literal_eval(self.display)
|
|
|
|
display_dict = ast.literal_eval(self.display)
|
|
|
|
return display_dict
|
|
|
|
return display_dict
|
|
|
@ -333,15 +333,15 @@ def setup_db():
|
|
|
|
'value': Column(String)}
|
|
|
|
'value': Column(String)}
|
|
|
|
cc_classes[row.id] = type('Custom_Column_' + str(row.id), (Base,), ccdict)
|
|
|
|
cc_classes[row.id] = type('Custom_Column_' + str(row.id), (Base,), ccdict)
|
|
|
|
|
|
|
|
|
|
|
|
for id in cc_ids:
|
|
|
|
for cc_id in cc_ids:
|
|
|
|
if id[1] == 'bool':
|
|
|
|
if cc_id[1] == 'bool':
|
|
|
|
setattr(Books, 'custom_column_' + str(id[0]), relationship(cc_classes[id[0]],
|
|
|
|
setattr(Books, 'custom_column_' + str(cc_id[0]), relationship(cc_classes[cc_id[0]],
|
|
|
|
primaryjoin=(
|
|
|
|
primaryjoin=(
|
|
|
|
Books.id == cc_classes[id[0]].book),
|
|
|
|
Books.id == cc_classes[cc_id[0]].book),
|
|
|
|
backref='books'))
|
|
|
|
backref='books'))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
setattr(Books, 'custom_column_' + str(id[0]), relationship(cc_classes[id[0]],
|
|
|
|
setattr(Books, 'custom_column_' + str(cc_id[0]), relationship(cc_classes[cc_id[0]],
|
|
|
|
secondary=books_custom_column_links[id[0]],
|
|
|
|
secondary=books_custom_column_links[cc_id[0]],
|
|
|
|
backref='books'))
|
|
|
|
backref='books'))
|
|
|
|
|
|
|
|
|
|
|
|
# Base.metadata.create_all(engine)
|
|
|
|
# Base.metadata.create_all(engine)
|
|
|
|