mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 01:21:07 +00:00
Narrow down bare type: ignore
pragmas
This commit is contained in:
parent
29f852b57e
commit
e6ee169c3e
2 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
""" Database utilities """
|
||||
|
||||
from typing import Optional, Iterable, Set, cast
|
||||
import sqlparse # type: ignore
|
||||
import sqlparse # type: ignore[import-untyped]
|
||||
|
||||
|
||||
def format_trigger(sql: str) -> str:
|
||||
|
|
|
@ -222,17 +222,17 @@ class PartialDateDescriptor:
|
|||
return [("DAY", "Day prec."), ("MONTH", "Month prec."), ("YEAR", "Year prec.")]
|
||||
|
||||
|
||||
class PartialDateModel(models.DateTimeField): # type: ignore
|
||||
class PartialDateModel(models.DateTimeField): # type: ignore[type-arg]
|
||||
"""a date field for Django models, using PartialDate as values"""
|
||||
|
||||
descriptor_class = PartialDateDescriptor
|
||||
|
||||
def formfield(self, **kwargs): # type: ignore
|
||||
def formfield(self, **kwargs): # type: ignore[no-untyped-def]
|
||||
kwargs.setdefault("form_class", PartialDateFormField)
|
||||
return super().formfield(**kwargs)
|
||||
|
||||
# pylint: disable-next=arguments-renamed
|
||||
def contribute_to_class(self, model, our_name_in_model, **kwargs): # type: ignore
|
||||
def contribute_to_class(self, model, our_name_in_model, **kwargs): # type: ignore[no-untyped-def]
|
||||
# Define precision field.
|
||||
descriptor = self.descriptor_class(self)
|
||||
precision: models.Field[Optional[str], Optional[str]] = models.CharField(
|
||||
|
|
Loading…
Reference in a new issue