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.
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:
This does not import the actual model classes but rather the module that contains them. The quick fix is just:
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.