M
M
mcrack2022-02-12 21:00:09
Django
mcrack, 2022-02-12 21:00:09

How to modify queryset in Django?

Hello, tell me how you can solve this problem:
There is a Lesson model with lessons, in which there is a raiting field (a field that indicates how many points should be received to complete the lesson)
I want to add one more parameter to the queryset, whether the student has reached this number of points or not.

It is considered so, the id of the student is transmitted, he gets his points for the lesson.

So the problem is that I want to pass my parameter to the queryset, which will affect the selection, namely, add a new calculated field to the selection.

How can you do it right? How to pass some values ​​​​outside to the queryset so that they already modify the selection?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2022-02-12
@bacon

https://docs.djangoproject.com/en/4.0/ref/models/q...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question