From 497abf26cd4d7b03c0afdd456696f14bd3824367 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 20 Sep 2020 12:46:38 -0700 Subject: [PATCH] Move circular dependency to end of file. --- etiquette/decorators.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/etiquette/decorators.py b/etiquette/decorators.py index 0bbb3a6..c0ae60e 100644 --- a/etiquette/decorators.py +++ b/etiquette/decorators.py @@ -5,7 +5,6 @@ import warnings from . import exceptions def _get_relevant_photodb(instance): - from . import objects if isinstance(instance, objects.ObjectBase): photodb = instance.photodb else: @@ -97,3 +96,10 @@ def transaction(method): return result 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