In the admin, would it be possible to filter selection from a live input in a field:
class ReadtToday(models.Model):
author = models.ForeignKey(Authors) # field 1)
book = models.OneToOneField(Books, related_name='bookofday') # field 2)
Now in the admin for 1) and 2) got a list of all of them, how I should proceed to get this behavior:
select author from field 1) autoupdate field 2) list with only data from current selected author selected by field 1).
class BooksList(admin.ModelAdmin):
def get_queryset(self, request):
qs = super(BooksList, self).get_queryset(request)
return qs.filter(HowCanIGetAuthor=from_input_of_field_1)
Is possbile to apply field 1) selection to filter fields 2) using raw_id_fields
?