I have one ManyToMany model that I am using for two fields on a Model:
class SomeModel(models.Model):
deposit = models.ManyToManyField(PaymentMethod, related_name="deposit")
withdrawal = models.ManyToManyField(PaymentMethod, related_name="withdrawal")
Then in my admin file I have this:
class SomeModelAdmin(admin.ModelAdmin):
list_filter = ('deposit', 'withdrawal',)
The only problem with this is that on the filter on the listing page (in the right column). It says “By Payment Method”, instead of “By Deposit” and “By Withdrawal”.
This is a known bug:
https://code.djangoproject.com/ticket/15221
This is a workaround (for version 1.4). It’s ugly, but at least it’s not monkey patching: