Django SVN Update Goes Splat

Published on May 9, 2007

I'm writing this just in case somebody runs into this same issue. I'm about to go live with a website and figured it would be best to have the latest SVN snapshot checked out from Django. I updated, and noticed that my voting module didn't quite work as expected. I was getting the following error:

'module' object has no attribute 'GenericForeignKey'

I jumped into Trac and noticed that just yesterday some things were rearranged. In short, if you are using generic relations, you'll need to change two parts of your code. First, the generic relations field must be imported out of conttenttype.

from django.contrib.contenttypes import generic

And second, you'll need to change the 'location prefix' (for lack of a better description:

From:
generic_field = models.GenericRelation(SomeOtherModel)
To:
generic_field = generic.GenericRelation(SomeOtherModel)

All should be find from there on out. For more information, take a look at the reference wiki article.



blog comments powered by Disqus

About This Page

This entry is from my articles section and was written on May 9, 2007. It's been tagged with doh and django.

Via Twitter

Restaurant in Budapest : 19 people in non-smoking section, 1 in smoking section. I miss non-smoking pubs. (4 months, 3 weeks ago)

Recent Entries RSS

Currently Reading