In [4]:
from django.contrib.contenttypes.models import ContentType
In [1]:
Upload.objects.all()
Out[1]:
In [21]:
for upload in Upload.objects.all():
print(upload.content_object)
upload.content_object.delete()
upload.delete()
In [3]:
upload = Upload.objects.all()[0]
In [5]:
upload.content_object
Out[5]:
In [17]:
list(Image.objects.all().order_by("-created"))[0].delete()
Out[17]:
In [ ]: