@@ -338,12 +338,12 @@ class Tag(Model):
@staticmethod
def clean():
unused = (
- Tag.select(Tag.id)
+ Tag.select(Tag.id) # type: ignore
.join(HasTag, peewee.JOIN.LEFT_OUTER)
.group_by(Tag.name)
.having(peewee.fn.COUNT(HasTag.id) == 0)
)
- Tag.delete().where(Tag.id.in_(unused)).execute()
+ Tag.delete().where(Tag.id.in_(unused)).execute() # type: ignore
class HasTag(Model):
@@ -40,6 +40,10 @@ class Model:
def alias(cls: Type[T]) -> Type[T]:
pass
+ @classmethod
+ def delete(self) -> Any:
+ pass
+
# These all do things that MyPy chokes on, so we're going to treat
# them like methods instead of naming classes
@@ -61,3 +65,7 @@ def ForeignKeyField(key: object, null: bool = None, backref: str = "") -> Any:
class IntegrityError(Exception):
+JOIN: Any = None
+fn: Any = None