divio/django-shop — pull request #125 by simonluijk (2011-12-10 14:26:27+00:00)
Title: Prevent circular imports when defining custom shop models

The underlying problem is when you import

shop.models.defaults.bases.BaseProduct

or the other base models in your project. It will also
import shop/models/__init__.py if you then have the
SHOP_x_MODEL set to a Model you later define in this
same file, you will get a circular import. Or if you use
the other solutions so far, django-SHOP will try and import
the custom model before it has been instantiated. The only
way to fix this is to move anything the project needs to
build a custom module outside shop.models. At the moment
that is base models and managers. This needs to be done
in combination with the previous solution, which I have
included here.

There are a few fixes that can be applied to make this
backwards compatible. Are you maintaining backwards
compatibility before 1.0?

Tests are on their way. But right now it is an unusually
sunny day for this time of year :)

Signed-off-by: Simon Luijk