Skip to content
Discussion options

You must be logged in to vote

Hi All,

My issue has been fixed.

Actually I created new app with custom region (IamsRegion) and custom site (IamsSite) and in views.py file I created IamsRegionListView as:

class IamsRegionListView(generic.ObjectListView):
queryset = IamsRegion.objects.all()
filterset = filtersets.IamsRegionFilterSet
filterset_form = forms.IamsRegionFilterForm
table = tables.IamsRegionTable

while it should be:

class IamsRegionListView(generic.ObjectListView):
queryset = IamsRegion.objects.add_related_count(
IamsRegion.objects.all(),
IamsSite,
'region',
'site_count',
cumulative=True
)
filterset = filtersets.IamsRegionFilterSet
filterset_form = forms.IamsRegionFilterForm
table = tables.IamsRegionTable

Thank…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hamidallaoui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants