From b53f5fcf40ff73e6710c482a7fd6b57cf1cd58e0 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Mon, 25 May 2015 12:18:51 +0200 Subject: [PATCH] Method for getting a field definition from the form definition. Replaces previous private method. --- src/scriptform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scriptform.py b/src/scriptform.py index b5e32d9..80e9606 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -388,7 +388,7 @@ class FormDefinition: self.submit_title = submit_title self.allowed_users = allowed_users - def _get_field(self, field_name): + def get_field_def(self, field_name): for field in self.fields: if field['name'] == field_name: return field @@ -429,7 +429,7 @@ class FormDefinition: this class in the form 'validate_'. """ # Find field definition by iterating through all the fields. - field_def = self._get_field(field_name) + field_def = self.get_field_def(field_name) if not field_def: raise ValidationError("Unknown field: {0}".format(field_name))