Dovresti usare SQL personalizzato invece di Manager.raw()
metodo:
from django.db import connection
cursor = connection.cursor()
cursor.execute('SELECT max(value) FROM mytable')
max_value = cursor.fetchone()[0]
Dovresti usare SQL personalizzato invece di Manager.raw()
metodo:
from django.db import connection
cursor = connection.cursor()
cursor.execute('SELECT max(value) FROM mytable')
max_value = cursor.fetchone()[0]