Improve assertion in convert_domain of Function field

The field name from the domain could be a nested if the Function field is
relational. So it must just if it starts with the name of the field.
This commit is contained in:
Cédric Krier
2016-12-22 01:15:46 +01:00
parent 4d5046f028
commit dd3e0a4c2a
+1 -1
View File
@@ -63,7 +63,7 @@ class Function(Field):
def convert_domain(self, domain, tables, Model):
name, operator, value = domain[:3]
assert name == self.name
assert name.startswith(self.name)
method = getattr(Model, 'domain_%s' % name, None)
if method:
return method(domain, tables)