python - Django nested inlines not working? -
i've installed django-nested-inline have problems. here's code:
from django.contrib import admin nested_inline.admin import nestedstackedinline, nestedmodeladmin .models import positive, negative, option, question class positiveinline(nestedstackedinline): model = positive class negativeinline(nestedstackedinline): model = negative class optioninline(nestedstackedinline): model = option inlines = [positiveinline, negativeinline,] class questionadmin(nestedmodeladmin): fieldsets = [ (none, {'fields': ['question_title']}), ('date information', {'fields': ['pub_date'], 'classes': ['collapse']}), ] inlines = [optioninline,] admin.site.register(question, questionadmin)
when try add new question, have error:
attributeerror @ /admin/question/question/add/ 'optioninline' object has no attribute 'queryset'
am doing wrong?
posted comment, since worked out i'll post here future reference. seems result of bug, referenced , fix has been applied here: https://github.com/s-block/django-nested-inline/issues/31
Comments
Post a Comment