Commit b7ff62c
Modle._meta.pk is non-None (#13)
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)
Co-authored-by: Anthony Sottile <asottile@umich.edu>1 parent 0aab510 commit b7ff62c
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