Fixed #30477 -- Made reverse lookup use Field.get_db_prep_value() from the target field.

This commit is contained in:
can 2019-06-24 18:48:10 +03:00 committed by Mariusz Felisiak
parent 76b993a117
commit 325d5d6445
3 changed files with 29 additions and 14 deletions

View file

@ -67,10 +67,15 @@ class Annotation(models.Model):
return self.name
class DateTimePK(models.Model):
date = models.DateTimeField(primary_key=True, auto_now_add=True)
class ExtraInfo(models.Model):
info = models.CharField(max_length=100)
note = models.ForeignKey(Note, models.CASCADE, null=True)
value = models.IntegerField(null=True)
date = models.ForeignKey(DateTimePK, models.SET_NULL, null=True)
class Meta:
ordering = ['info']