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 import when loading module lfs.catalog #108

Closed IsmaelMT closed 11 years ago

IsmaelMT commented 11 years ago

I was working on the last commit and there is a problem when i try to run "runserver", the error is "ImportError: no module named Product". The error is from commit 6f238ec23d57ce298d83452bad6e8ae110986308 from February 5th 2013. There where some changes at the caching module.

From catalog, caching.utils is imported and from caching.utils at listener.py lfs.catalog is imported but lfs.catalog was not loaded.

pigletto commented 11 years ago

Can you paste full traceback? It works for me.

IsmaelMT commented 11 years ago

File "/home/ismael/.virtualenvs/klick/src/lfs/lfs/catalog/models.py", line 17, in from lfs.caching.utils import get_cache_group_id File "/home/ismael/.virtualenvs/klick/src/lfs/lfs/caching/init.py", line 1, in from listeners import * File "/home/ismael/.virtualenvs/klick/src/lfs/lfs/caching/listeners.py", line 11, in from lfs.cart.models import Cart File "/home/ismael/.virtualenvs/klick/src/lfs/lfs/cart/models.py", line 14, in from lfs.catalog.models import Product ImportError: cannot import name Product

pigletto commented 11 years ago

I've commited a change. Please try if it works for you now. I was not able to reproduce it at my box

IsmaelMT commented 11 years ago

I fixed it locally the same way you just did, but i wasn't sure if that was the best way because i'm still not used to the code, if some issue like this comes up can i do any commit to colaborate?

pigletto commented 11 years ago

Of course you can collaborate. Best way is to fork the repository, create so called topic branch that isolates changes specific to issue and do some changes there. Then you can do a pull request. See: https://help.github.com/articles/using-pull-requests

IsmaelMT commented 11 years ago

Ok thanks, i will, the solution you proposed works well.