diff --git a/openlibrary/core/lists/model.py b/openlibrary/core/lists/model.py index f75ecb68f6b..5a82a3a6577 100644 --- a/openlibrary/core/lists/model.py +++ b/openlibrary/core/lists/model.py @@ -14,7 +14,7 @@ from openlibrary.core import helpers as h from openlibrary.core import cache -from openlibrary.core.models import Image, Subject, Thing, ThingKey +from openlibrary.core.models import Image, Subject, Thing, ThingKey, ThingReferenceDict from openlibrary.plugins.upstream.models import Author, Changeset, Edition, User, Work from openlibrary.plugins.worksearch.search import get_solr @@ -24,10 +24,6 @@ logger = logging.getLogger("openlibrary.lists.model") -class ThingReferenceDict(TypedDict): - key: ThingKey - - SeedSubjectString = str """ When a subject is added to a list, it's added as a string like: diff --git a/openlibrary/core/models.py b/openlibrary/core/models.py index beb6a3f5991..4266a026627 100644 --- a/openlibrary/core/models.py +++ b/openlibrary/core/models.py @@ -8,7 +8,7 @@ import web import json import requests -from typing import Any +from typing import Any, TypedDict from collections import defaultdict from dataclasses import dataclass, field @@ -219,6 +219,10 @@ def _get_d(self): } +class ThingReferenceDict(TypedDict): + key: ThingKey + + class Edition(Thing): """Class to represent /type/edition objects in OL.""" diff --git a/openlibrary/macros/TableOfContents.html b/openlibrary/macros/TableOfContents.html index 5ca39eefce6..6a83a1fd25f 100644 --- a/openlibrary/macros/TableOfContents.html +++ b/openlibrary/macros/TableOfContents.html @@ -1,31 +1,38 @@ -$def with (table_of_contents, ocaid=None, highlighting=False, cls='', attrs='') +$def with (table_of_contents, ocaid=None, cls='', attrs='') $ min_level = min(chapter.level for chapter in table_of_contents)