[Fixed]-Django – Query parameter takes model type? RelatedObjectDoesNotExist: Posting has no textbook

1👍

The content_type argument should be a ContentType object, not a model class.

Instead of doing doing this manually you should use the LogEntryManagers get_for_model method:

LogEntry.objects.get_for_model(Posting).filter(action=2).count()

Leave a comment