hovel / imagestore

Django gallery solution.
BSD 3-Clause "New" or "Revised" License
164 stars 71 forks source link

Models are imported incorrectly #10

Closed amirrustam closed 9 years ago

amirrustam commented 12 years ago

Today I was having an trouble with AttributeError which said Exception Value: 'module' object has no attribute '_meta'.

This is because models are currently imported as such through out the source:

from imagestore.models import Album, Image, AlbumUpload

This does not import the actual model classes but rather the module that contains them. The quick fix is just:

from imagestore.models.image import Image
from imagestore.models.album import Album
from imagestore.models.upload import AlbumUpload

I personally don't understand why each model class needs to be in its own file. Maybe someone can explain the reason behind the current model module structure to me? For now I hope this helps someone out that doesn't see the fix quickly on their own.

zeus commented 12 years ago

This split allow to extend and replace model per project level. Can you provide a test case that cause this bug?

amirrustam commented 9 years ago

This is an old and irrelevant issue now. Gonna close it.