I am striking a bug which seems to derive from concrete model inheritance, and I’m really stumped.
Question is the model from the tutorial, essentially a short text that serves as a ForeignKey for Answers from different users. (There are a lot of different Answer types, which is where the suggested values in the error message are coming from).
The model QuestionAbout concretely inherits from Question and is in a different app. It adds a ContentObject from the ContentTypes framework so that the Question is associated with a particular object (and becomes a question about that object).
class QuestionAbout(Question):
""" Question about things """
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')
The error is:
django.core.exceptions.FieldError: Cannot resolve keyword 'question_ptr' into field. Choices are: answer_type, brainstorm, brvm, child_question, choice, diagram, dropbox, ej_four_field, ej_three_field, externalfilter, extra, fb, id, long_answer, man_index, man_page, man_rank, max_entries, multiple_entries, nexus, number, numbertype, optionset, parent_question, parent_question_id, question_answers, question_text, questionabout, semiopen, seq, short_answer, stdchoicegroup, stdvote, tagged_items, tags, task, task_id, vote
If we exclude the QuestionAbout model, dumpdata runs to completion. The full list of possible fields includes a lot of non-concrete fields, one of which is ‘questionabout’ - which I thought might have been a renamed version or the reverse relation of ‘question_ptr’, but the documentation is still clear that an autogenerated ‘_ptr’ field is used.