Answer the question
In order to leave comments, you need to log in
How to return QuerySet from View?
I have such a function for selecting several objects, which I call from ajax:
def get_elements(request):
"""View function for getting all existed elements (lines) of the scheme of the specific plan"""
data = request.GET
plan = get_object_or_404(Plan, pk=data.get("plan"))
v = Element.objects.filter(plan=plan)
return ...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question