W
W
Werdjill2020-04-26 20:39:00
Django
Werdjill, 2020-04-26 20:39:00

super(). in Django, what is it?

Good evening, now I'm studying Django from a book, I came across a code, in general, everything is clear, except for one thing, what is super()., I searched on the Internet, but did not understand the essence. The question is, help me understand what super() is. what it is for, where it is used in a simple language. Be grateful for help.

Code from the Book:

class BbCreateView(CreateView):
    template_name = 'bboard/create.html'
    form_class = BbForm
    success_url = reverse_lazy('index')

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        context["rubris"] = Rubric.objects.all()
        return context

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey Gornostaev, 2020-04-26
@sergey-gornostaev

You should first learn the Python programming language before taking on the study of frameworks written in it.

A
alternativshik, 2020-04-26
@alternativshik

This is an extra reminder that Janga is great!

V
Vadim Shatalov, 2020-04-26
@netpastor

https://lmgtfy.com/?q=%D1%87%D1%82%D0%BE+%D1%82%D0...

R
rim101, 2021-03-28
@rim101

Super is a class in Python. I'm still learning myself, incl. I can't tell what's going on in your example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question