try fixing ctypes

This commit is contained in:
Sanjay B 2013-09-23 20:33:55 +05:30
parent 9a80c9f5b9
commit 15c926c266

View File

@ -124,10 +124,11 @@ class ItfModel(models.Model):
return d
def get_content_type(self):
for c in ContentType.objects.filter(model=self.__class__._meta.module_name):
if c.model_class() is not None and isinstance(c.model_class(), ItfModel):
return c
raise
return ContentType.objects.get_for_model(self.__class__)
# for c in ContentType.objects.filter(model=self.__class__._meta.module_name):
# if c.model_class() is not None and isinstance(c.model_class(), ItfModel):
# return c
# raise
def get_gallery_image(self):
from mediagallery.models import Photo