Move circular dependency to end of file.

master
voussoir 2020-09-20 12:46:38 -07:00
parent 407770a80e
commit 497abf26cd
1 changed files with 7 additions and 1 deletions

View File

@ -5,7 +5,6 @@ import warnings
from . import exceptions from . import exceptions
def _get_relevant_photodb(instance): def _get_relevant_photodb(instance):
from . import objects
if isinstance(instance, objects.ObjectBase): if isinstance(instance, objects.ObjectBase):
photodb = instance.photodb photodb = instance.photodb
else: else:
@ -97,3 +96,10 @@ def transaction(method):
return result return result
return wrapped_transaction return wrapped_transaction
# Circular dependency.
# I would like to un-circularize this, but as long as objects and photodb are
# using the same decorators, and the decorator needs to follow the photodb
# instance of the object...
# I'd rather not create separate decorators, or write hasattr-based decisions.
from . import objects