Changes between Version 2 and Version 3 of Ticket #30386, comment 6
- Timestamp:
- Oct 7, 2021, 8:35:52 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30386, comment 6
v2 v3 1 1 I'm dive deeper into this and found that `quote(obj.id)` maybe not the best option and should be debated but the presence of a warning message when `not isinstance(obj.pk, int)` would be great and will lead people to this thread. Because stackoverflow is full of questions about quoting the link in admin but no one provide refs to this ticket that I found after couple hours of code investigating and testing. 2 2 3 Something like this in django.db.models.fields. related.ForeignKey:3 Something like this in django.db.models.fields.RelatedField: 4 4 5 5 6 6 {{{ 7 class ForeignKey(ForeignObject):7 class RelatedField(FieldCacheMixin, Field): 8 8 9 9 def check(self, **kwargs): 10 10 return [ 11 *super().check(**kwargs), 12 *self._check_on_delete(), 13 *self._check_unique(), 11 # ... 14 12 *self._check_pk_int(), 15 13 ]