Gebruik aangepaste SQL in plaats van Manager.raw()
methode:
from django.db import connection
cursor = connection.cursor()
cursor.execute('SELECT max(value) FROM mytable')
max_value = cursor.fetchone()[0]
Gebruik aangepaste SQL in plaats van Manager.raw()
methode:
from django.db import connection
cursor = connection.cursor()
cursor.execute('SELECT max(value) FROM mytable')
max_value = cursor.fetchone()[0]