我正在为需要通过管理界面支持图片上传(艺术家)的客户端构建网站。由于大多数图像都很高分辨率,因此我想创建图像的缩略图以在上传后显示在图库页面上。上传与forms.ImageFile元素非常相称,但我正在寻找一些关于如何进行实际大小调整以及拇指与真实大小图像之间的链接的想法。我有一个想法,以保持模型类两种图像和图像的拇指: from django.db import models
class I
比方说,我有这样的模式: class Foo(models.Model):
bar = models.ForeignKey(Bar)
currency = models.ForeignKey(Currency) # currency is just an example
is_active = models.BooleanField()
现在假设foo是酒吧的内联