Thanks for the detailed response, Karen. I was just worried at first that isnull was an improper way of checking for Authors with no Entry (the hints came from this message [
http://groups.google.com/group/django-users/msg/47ba69359ceace29] which I may have misinterpreted, the docs don't seem to reference this situation directly). But now I see that all filters using Entry are returning the same error, not just isnull, so it's definitely a problem in my code.
I identified the commit in my own code that blew things up (thanks to my excellent version-tracking habits, it's a pretty large and tangled commit). This commit touches neither the Author nor the Entry model, it's got:
Two new models, one called Sample with a ForeignKey to Author, one called TranslatorProfile with a OneToOneField to Author (no related names on either).
ModelForms for both of these new models. I also moved two existing modelforms to a different place in the file.
I'm putting the diff file into dpaste here:
http://dpaste.com/49912/, in case anyone's got the patience to look at it. That's a diff between -r301, which works, and working copy, which doesn't. The whole models.py file (broken working copy) is here:
http://dpaste.com/49913/
The only other possibly relevant thing I can think of is that Entries also have a ManyToMany to Authors. An Entry is written by an Author (the ForeignKey), but can also be "about" some unspecified number of Authors. The ManyToMany has a related name on it, the ForeignKey doesn't, but changing that doesn't fix the code, and besides it has been working fine like that up until now.
Many thanks for any insight!
Eric
and, for the heck of it, the traceback:
Traceback:
File "/Library/Python/2.5/site-packages/django-trunk/django/core/handlers/base.py" in get_response
92. response = callback(request, *callback_args, **callback_kwargs)
File "/Library/Python/2.5/site-packages/django-trunk/django/utils/decorators.py" in _wrapped_view
48. response = view_func(request, *args, **kwargs)
File "/Users/eric/stuff/dbase/views.py" in contributors
128. conts = list(Author.objects.contributors())
File "/Users/eric/stuff/dbase/managers.py" in contributors
34. return self.select_related("user").filter(is_contributor=True).exclude(entry__isnull=True)
File "/Library/Python/2.5/site-packages/django-trunk/django/db/models/query.py" in exclude
474. return self._filter_or_exclude(True, *args, **kwargs)
File "/Library/Python/2.5/site-packages/django-trunk/django/db/models/query.py" in _filter_or_exclude
483. clone.query.add_q(~Q(*args, **kwargs))
File "/Library/Python/2.5/site-packages/django-trunk/django/db/models/sql/query.py" in add_q
1610. self.add_q(child, used_aliases)
File "/Library/Python/2.5/site-packages/django-trunk/django/db/models/sql/query.py" in add_q
1614. can_reuse=used_aliases)
File "/Library/Python/2.5/site-packages/django-trunk/django/db/models/sql/query.py" in add_filter
1512. negate=negate, process_extras=process_extras)
File "/Library/Python/2.5/site-packages/django-trunk/django/db/models/sql/query.py" in setup_joins
1677. "Choices are: %s" % (name, ", ".join(names)))
Exception Type: FieldError at /contributors/
Exception Value: Cannot resolve keyword 'entry' into field. Choices are: book, categories, characters, contact, cv, desc, desc_HTML, edit_date, email, gender, given_name, id, is_author, is_chinese, is_contributor, is_living, is_translator, links, location, photo, post_date, profession, rel_entries, sample, slug, surname, translatorprofile, user, webpage