diefenbach / django-lfs

An online-shop based on Django
http://www.getlfs.com
BSD 3-Clause "New" or "Revised" License
622 stars 222 forks source link

Circular reference with lfs.customer.utils #192

Closed pfennema closed 7 years ago

pfennema commented 9 years ago

I want to get the customer information in my CustomPriceCalculator hence I need to import the get_customer function:

from ls.customer.utils import get_customer

However, when I do this I get an error in lfs/core/monkeys.py as it cannot import the utils library.

from lfs.customer import utils as customer_utils
ImportError: cannot import name utils

Any clue how to resolve this?

Thanks, Paul

pfennema commented 9 years ago

I actually resolved it just now to import ls.customer only:

import lfs.customer as lfs_customer

and in the code getting the get_customer by:

        customer = lfs_customer.utils.get_customer(self.request)

However, is this the preferred way to resolve the circular reference?