{
  "id": "python/django-orm-related-name-conflict",
  "signature": "django.core.exceptions.FieldError: Related model 'Author' cannot be resolved",
  "signature_zh": "字段错误：无法解析相关模型 'Author'",
  "regex": "django\\.core\\.exceptions\\.FieldError:\\ Related\\ model\\ 'Author'\\ cannot\\ be\\ resolved",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The related_name in ForeignKey conflicts with an existing field or is invalid.",
  "root_cause_type": "generic",
  "root_cause_zh": "ForeignKey 中的 related_name 与现有字段冲突或无效。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Removing related_name doesn't fix if the default related name conflicts.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Changing the model name in settings doesn't resolve the relationship.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Set a unique related_name: author = models.ForeignKey(Author, related_name='books')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use related_query_name to avoid conflict: related_query_name='author'",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2026-03-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}