# 字段错误：无法将关键字 'tags' 解析为字段。可选字段：id, title, content

- **ID:** `python/django-many-to-many-relationship-error`
- **领域:** python
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

尝试查询模型中不存在的多对多字段。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   Check model definition: ensure ManyToManyField exists, then run makemigrations and migrate.
   ```
2. **** (85% 成功率)
   ```
   Use the correct related_name: Post.tags.all() if related_name='tags'.
   ```

## 无效尝试

- **** — Adding the field to the model without running migrations doesn't make it available immediately. (60% 失败率)
- **** — Using the wrong related_name in query leads to same error. (70% 失败率)
