How do I get the size and name of a FileField in a template?
My model is setup like this:
class PDFUpload(models.Model):
user = models.ForeignKey(User, editable=False)
desc = models.CharField(max_length=255)
file = models.FileField(upload_to=upload_pdf)
My template is setup like this:
{% for download in downloads %}
<div class="download">
<div class="title"> Name</div>
<div class="size">64.5 MB</div>
<div class="desc">{{download.desc}}</div>
</div>
{% endfor %}
How can I display the file name and size?