Expand focus from paintings to more artworks
Replace all references to 'painting' with 'artwork'
This commit is contained in:
parent
df8ff30b64
commit
036a4be5ed
14 changed files with 76 additions and 76 deletions
|
|
@ -78,7 +78,7 @@ class QueryResultRow:
|
|||
for k, v in self.row.items()
|
||||
if not k.startswith('item')]
|
||||
|
||||
class Painting:
|
||||
class Artwork:
|
||||
def __init__(self, qid):
|
||||
self.entity = mediawiki.get_entity_with_cache(qid)
|
||||
self.item_id = int(qid[1:])
|
||||
|
|
@ -45,8 +45,8 @@ class DepictsItemAltLabel(Base):
|
|||
def __init__(self, alt_label):
|
||||
self.alt_label = alt_label
|
||||
|
||||
class PaintingItem(Base):
|
||||
__tablename__ = 'painting'
|
||||
class ArtworkItem(Base):
|
||||
__tablename__ = 'artwork'
|
||||
item_id = Column(Integer, primary_key=True, autoincrement=False)
|
||||
label = Column(String)
|
||||
entity = Column(postgresql.JSON)
|
||||
|
|
@ -80,15 +80,15 @@ class Language(Base):
|
|||
class Edit(Base):
|
||||
__tablename__ = 'edit'
|
||||
username = Column(String, primary_key=True)
|
||||
painting_id = Column(Integer, ForeignKey('painting.item_id'), primary_key=True)
|
||||
artwork_id = Column(Integer, ForeignKey('artwork.item_id'), primary_key=True)
|
||||
depicts_id = Column(Integer, ForeignKey('depicts.item_id'), primary_key=True)
|
||||
timestamp = Column(DateTime, default=now_utc())
|
||||
lastrevid = Column(Integer, nullable=True)
|
||||
|
||||
painting_qid = column_property('Q' + cast(painting_id, String))
|
||||
artwork_qid = column_property('Q' + cast(artwork_id, String))
|
||||
depicts_qid = column_property('Q' + cast(depicts_id, String))
|
||||
|
||||
painting = relationship('PaintingItem')
|
||||
artwork = relationship('ArtworkItem')
|
||||
depicts = relationship('DepictsItem')
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ def check_catalog(entity, catalog):
|
|||
'description': description,
|
||||
}
|
||||
|
||||
def get_catalog_from_painting(entity):
|
||||
def get_catalog_from_artwork(entity):
|
||||
catalog_ids = find_catalog_id(entity)
|
||||
catalog_detail = []
|
||||
for property_id in sorted(catalog_ids):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue