First of all, I'm using Django 2.2 and Python 3.7
I have this in my models.py
class Test(models.Model):
session = models.IntegerField()
x_pos = models.IntegerField()
y_pos = models.IntegerField()
What am trying to do is to get the max value of 'session' from my database.
In my views.py I succesfully get the max value by this:
from .models import Test
from django.db.models import Max
max_session = Test.objects.all().aggregate(Max('session'))
print(max_session)
The problem is when I print the result i get {'session__max': 35}
How can I get the value 35 only, in my max_session variable?