On 12/24/2011 12:55 PM, Diederik van der Boor wrote:
Hi,

I've encountered a bug with the contenttypes framework when a model is
removed. You'll end up with a AttributeError in _add_to_cache():

        'NoneType' object has no attribute '_meta'

That's because the ContentType still exists, byt ContentType.

I would like to solve it, yet I'm not sure about the recommended approach:
1. returning None for ContentType.objects.get_for_id() when the model does not
exist.
2. Raise an exception that the referenced model does not exist.

What is your idea on this?

This bug currently hits me because django-polymorphic (which I use) uses the
contenttype framework to upcast the models. As the models are removed, but the
contenttype still exists, making queries causes an AttributeError. When Django
returns a normal response, I'll see how to address this issue in django-
polymorphic too.

Best regards,

Diederik


Hi,

I'm not sure this is not entirely related to django-polymorphic, yet
a traceback would have been helpful in understanding your code. :)

cheers,
E

--
Etienne Robillard
Lead Developer and Consultant
Green Tea Hackers Club
Email:      animelo...@gmail.com
Website:    http://gthcfoundation.org

--
You received this message because you are subscribed to the Google Groups "Django 
developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to