我有以下模型:
class PropertyPhoto(models.Model):
property = models.ForeignKey('Property')
photo_show = ProcessedImageField(upload_to=get_web_watermark,
processors=[Watermark()],
options={'quality': 95})
和自定义水印类:
class Watermark(object):
def process(self, image):
try:
this_property = Property.objects.get(pk=*self.property.id*)
except Property.DoesNotExist:
print "error"
如何从 Watermark 类中访问我的模型属性“属性”?
谢谢