DJ1.9 compat field.related

This commit is contained in:
Marc Aymerich 2016-04-29 09:24:07 +00:00
parent ad2f8859c1
commit 2ae4b482f4

View file

@ -98,7 +98,8 @@ class PaymentStateListFilter(SimpleListFilter):
def queryset(self, request, queryset): def queryset(self, request, queryset):
# FIXME use queryset.computed_total instead of approx_total, bills.admin.BillAdmin.get_queryset # FIXME use queryset.computed_total instead of approx_total, bills.admin.BillAdmin.get_queryset
Transaction = queryset.model.transactions.field.related.related_model # Transaction = queryset.model.transactions.field.remote_field.related_model
Transaction = queryset.model.transactions.related.related_model
if self.value() == 'OPEN': if self.value() == 'OPEN':
return queryset.filter(Q(is_open=True)|Q(type=queryset.model.PROFORMA)) return queryset.filter(Q(is_open=True)|Q(type=queryset.model.PROFORMA))
elif self.value() == 'PAID': elif self.value() == 'PAID':