Saving the file_size in the database is already implemented for Wagtail images and documents.
file_size = models.PositiveIntegerField(null=True, editable=False)
The file_size is set in the save function, for example, in BaseImageForm.
I suggest implementing this for media as well. This would have the advantage of allowing objects to be sorted directly by file_size.
Saving the
file_sizein the database is already implemented for Wagtail images and documents.file_size = models.PositiveIntegerField(null=True, editable=False)The
file_sizeis set in thesavefunction, for example, inBaseImageForm.I suggest implementing this for media as well. This would have the advantage of allowing objects to be sorted directly by
file_size.