2
我有一個靈巧型,具有圖像字段定義是這樣的:圖片字段驗證爲特定的寬度/高度
image = NamedBlobImage(
title=_(u'Lead Image'),
description=_(u"Upload a Image of Size 230x230."),
required=True,
)
我如何添加一個驗證器來檢查上傳的圖片文件?例如,如果圖像寬度超過500像素,則警告用戶上傳另一個文件。提示或示例代碼表示讚賞。