Du bør bruge tilpasset SQL i stedet for Manager.raw()
metode:
from django.db import connection
cursor = connection.cursor()
cursor.execute('SELECT max(value) FROM mytable')
max_value = cursor.fetchone()[0]
Du bør bruge tilpasset SQL i stedet for Manager.raw()
metode:
from django.db import connection
cursor = connection.cursor()
cursor.execute('SELECT max(value) FROM mytable')
max_value = cursor.fetchone()[0]