Fixes circular import

This commit is contained in:
Mouse Reeve
2021-09-16 11:30:04 -07:00
parent fbe05623ff
commit 18591c7b56
5 changed files with 32 additions and 30 deletions

View File

@ -1,6 +1,5 @@
""" functionality outline for a book data connector """
from abc import ABC, abstractmethod
from dataclasses import asdict, dataclass
import logging
from django.db import transaction
@ -268,31 +267,6 @@ def get_image(url, timeout=10):
return resp
@dataclass
class SearchResult:
"""standardized search result object"""
title: str
key: str
connector: object
view_link: str = None
author: str = None
year: str = None
cover: str = None
confidence: int = 1
def __repr__(self):
return "<SearchResult key={!r} title={!r} author={!r}>".format(
self.key, self.title, self.author
)
def json(self):
"""serialize a connector for json response"""
serialized = asdict(self)
del serialized["connector"]
return serialized
class Mapping:
"""associate a local database field with a field in an external dataset"""