Python Django管理员,验证错误为flash?

Python Django管理员,验证错误为flash?,python,django,django-admin,Python,Django,Django Admin,我能够在django admin中显示验证错误消息。。使用这种方法 class TblSearchCase(models.Model): top_place_id = models.IntegerField() def clean(self): if self.top_place_id < 0: raise ValidationError("place id cannot be negative") TblSearchCase类(models

我能够在django admin中显示验证错误消息。。使用这种方法

class TblSearchCase(models.Model):
top_place_id = models.IntegerField()

def clean(self):
    if self.top_place_id < 0:
        raise ValidationError("place id cannot be negative")
TblSearchCase类(models.Model):
top\u place\u id=models.IntegerField()
def清洁(自清洁):
如果self.top\u place\u id<0:
raise ValidationError(“位置id不能为负”)
像这样

有没有一种简单的方法可以让它看起来像一条flash消息,而不必编辑模板