1
0
Fork 0

Type annotations for utils

This commit is contained in:
Joeri de Ruiter 2023-07-23 20:50:44 +02:00 committed by Joeri de Ruiter
parent 0f8da5b738
commit ff8e4597e5
6 changed files with 98 additions and 41 deletions

View file

@ -1,5 +1,7 @@
""" database schema for info about authors """
import re
from typing import Tuple, Any
from django.contrib.postgres.indexes import GinIndex
from django.db import models
@ -38,7 +40,7 @@ class Author(BookDataModel):
)
bio = fields.HtmlField(null=True, blank=True)
def save(self, *args, **kwargs):
def save(self, *args: Tuple[Any, ...], **kwargs: dict[str, Any]) -> None:
"""normalize isni format"""
if self.isni:
self.isni = re.sub(r"\s", "", self.isni)