Hi,
I have a Class result with foreign keys.
class Result(models.Model):
distance_id = models.ForeignKey(Distance, on_delete=models.CASCADE)
event_id = models.ForeignKey(Event, on_delete=models.CASCADE)
member_id = models.ForeignKey(Member, on_delete=models.CASCADE)
agegroup_id = models.ForeignKey(Agegroup, on_delete=models.CASCADE)
result_value = models.IntegerField()
and a class distance
class Distance(models.Model):
category_choices = [(‘d’, ‘distance’), (‘t’, ‘time’)]
sort = models.IntegerField(unique=True)
min = models.IntegerField()
max = models.IntegerField()
name = models.CharField(max_length=40, unique=True)
category = models.CharField(choices=category_choices, max_length=1)
If I choose add result I see only Distance object (x)
How can I change that list to the value of “name” or even better a “name, category”?
I there something like “list_display”?
Regards,
Andreas