I have been working in django CBV but i am stuck and cannot reslove it i also googled that thing but nothing much i get it sometimes in classes we use super
class ArticleCounterRedirectView(RedirectView):
permanent = False
query_string = True
pattern_name = 'article-detail'
def get_redirect_url(self, *args, **kwargs):
article = get_object_or_404(Article, pk=kwargs['pk'])
article.update_counter()
return super().get_redirect_url(*args, **kwargs)
class ArticleCounterRedirectView(RedirectView):
permanent = False
query_string = True
pattern_name = 'article-detail'
def get_redirect_url(self, *args, **kwargs):
article = get_object_or_404(Article, pk=kwargs['pk'])
article.update_counter()
return super(ArticleCounterRedirectView,self).get_redirect_url(*args, **kwargs)
we use super to to call the parent class then in one example we give no arguments and in another we give it two arguements please can someone help me out in this