django-baker
django-baker copied to clipboard
Error: 'ForeignKey' object has no attribute 'rel'
Getting 'ForeignKey' object has no attribute 'rel' on administration view. Model file attached models.py.txt
I also had this error when visiting the admin page for one of my models. It appears that field.rel was removed and so the call to field.rel.to.objects.count() in django_baker/admin.py fails. See https://docs.djangoproject.com/en/1.9/releases/1.9/#field-rel-changes.
If you don't mind losing admin filters, one work around is to implement get_list_filter() in each of your admin classes:
class MyModelAdmin(ExtendedModelAdminMixin, admin.ModelAdmin):
extra_list_display = []
extra_list_filter = []
.....
formfield_overrides = {}
readonly_fields = []
def get_list_filter(self, request):
return ()