diff --git a/matcher/model.py b/matcher/model.py index 1333267..796d28c 100644 --- a/matcher/model.py +++ b/matcher/model.py @@ -41,6 +41,11 @@ class Item(Base): if qid and len(qid) > 1 and qid[0].upper() == "Q" and qid[1:].isdigit(): return cls.query.get(qid[1:]) + @property + def wd_url(self): + return f"https://www.wikidata.org/wiki/{self.qid}" + + def get_claim(self, pid): return [i["mainsnak"]["datavalue"]["value"] if "datavalue" in i["mainsnak"] else None for i in self.claims.get(pid, [])] @@ -342,3 +347,9 @@ class ChangesetEdit(Base): changeset = relationship('Changeset', backref=backref('edits', lazy='dynamic')) + +class SkipIsA(Base): + __tablename__ = 'skip_isa' + item_id = Column(Integer, ForeignKey('item.item_id'), primary_key=True) + + item = relationship('Item') diff --git a/templates/admin/skip_isa.html b/templates/admin/skip_isa.html new file mode 100644 index 0000000..407a67c --- /dev/null +++ b/templates/admin/skip_isa.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} + +{% block title %}{% endblock %} + +{% block content %} +