New API for on_change

This commit is contained in:
resteve 2015-08-27 17:39:43 +02:00
parent 798ccb6a9c
commit aefcebc8ef

View file

@ -108,11 +108,10 @@ class GalateaTutorial(ModelSQL, ModelView):
'image_size': ('Thumb "%(file_name)s" size is larger than "%(size)s"Kb'),
})
@fields.depends('name', 'slug')
def on_change_name(self):
res = {}
if self.name and not self.slug:
res['slug'] = slugify(self.name)
return res
self.slug = slugify(self.name)
@classmethod
def write(cls, *args):