I have an a model:
class MyModel(models.Model):
file = models.FileField(verbose_name='File', upload_to="files/")
I can get file size in bytes:
size = my_model_instance.file.size
How to filter by file size in Django? Something like that:
MyModel.object.filter(file.size__lt=128)