{
  "id": "python/django-query-set-slicing",
  "signature": "TypeError: 'QuerySet' object is not subscriptable",
  "signature_zh": "类型错误：'QuerySet'对象不支持下标操作",
  "regex": "TypeError:\\ 'QuerySet'\\ object\\ is\\ not\\ subscriptable",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Attempting to slice a QuerySet that has already been evaluated or using wrong syntax.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试对已经求值或使用错误语法的QuerySet进行切片。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Loads all data into memory, defeating lazy evaluation.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Raises IndexError if empty.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use queryset[:5] for slicing or queryset.first() for first object.",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-25",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}