Commit e3f5b3d
authored
Model._meta.pk is non-None (#2218)
django internals frequently reference this as if it is always a field and looking at the source it is always set to some field during _prepare:
- https://github.com/django/django/blob/e99187e5c94516ee35f37cc41a36d906b395808d/django/db/models/options.py#L302-L320
- first branch through `setup_pk`: https://github.com/django/django/blob/e99187e5c94516ee35f37cc41a36d906b395808d/django/db/models/options.py#L361-L362
- second branch through:
- add_to_class: https://github.com/django/django/blob/e99187e5c94516ee35f37cc41a36d906b395808d/django/db/models/base.py#L371
- contribute_to_class: https://github.com/django/django/blob/e99187e5c94516ee35f37cc41a36d906b395808d/django/db/models/fields/__init__.py#L951
- add_field: https://github.com/django/django/blob/e99187e5c94516ee35f37cc41a36d906b395808d/django/db/models/options.py#L337
- (and then again setup_pk)1 parent a51f328 commit e3f5b3d
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments