Answer the question
In order to leave comments, you need to log in
How to call postgresql function from django with parameter passing?
There is such a function in views.py:
def getNearestNotes(request, longitude, latitude):
if request.method == 'GET':
#вызов функции
return HttpResponse('')
else:
return HttpResponse('needGetMethod')
Answer the question
In order to leave comments, you need to log in
from django.db import connection
some_arg = 42
c = connection.cursor()
try:
c.callproc('some_stored_procedure', (some_arg,))
r = c.fetchone()
...
finally:
c.close()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question