Debug with print

Hi, my problem debug print with manage.py runserver.
My code :

from django.views.decorators.csrf import csrf_exempt
import time

@csrf_exempt
def sort(self, *args, **kwarg):
    try:
        Photo.objects.filter(id__iexact=id).update(photo_order=time.time_ns())
        print(f"DEBUG {time.time_ns()} = {Photo.id} ")
    except ValueError:
        pass
    return HttpResponse("Created :)")

error:

print(f"DEBUG {time.time_ns()} = {Photo.id} ")

output:

DEBUG 1675354305020253821 = <django.db.models.query_utils.DeferredAttribute object at 0x7fac9635e0> 

how to solved problem with ID number photo gallery ?.
thanks.
I’am italian my english elementary and 41 old year.

Photo is a model and not an instance of a model. You need to execute a query to retrieve an instance that you can use in your print function.