{
  "id": "python/fastapi-pydantic-config-orm-mode",
  "signature": "PydanticUserError: `orm_mode` is removed. Use `from_attributes=True` instead.",
  "signature_zh": "PydanticUserError: `orm_mode` 已移除，请改用 `from_attributes=True`。",
  "regex": "PydanticUserError:\\ `orm_mode`\\ is\\ removed\\.\\ Use\\ `from_attributes=True`\\ instead\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A Pydantic model still uses v1's `orm_mode = True` Config under v2.",
  "root_cause_type": "generic",
  "root_cause_zh": "Pydantic 模型在 v2 下仍使用 v1 的 `orm_mode = True` 配置。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "orm_mode is rejected outright, so the model fails to import.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Then ORM objects can't be validated from attributes, breaking response_model.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.93,
      "how": "Use v2 config:\nclass UserOut(BaseModel):\n    model_config = ConfigDict(from_attributes=True)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Validate manually with model_validate(obj, from_attributes=True).",
      "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.89,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-09",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}