def queryset(self, request, queryset): if not self.value() or self.value() == 0: return queryset return Volunteer.objects.filter( tasks__edition=Edition.get_previous()).exclude( tasks__edition=Edition.get_current()).distinct()
def lookups(self, request, model_admin): edition = Edition.get_previous() return [(edition.id, edition.name)]