added custom field-record validator support, not using it yet though
This commit is contained in:
parent
edb8e90340
commit
f30237a90d
2 changed files with 8 additions and 0 deletions
7
model.py
7
model.py
|
@ -33,6 +33,13 @@ class Model(object):
|
|||
for f in self.get_fields():
|
||||
f.validate()
|
||||
|
||||
try:
|
||||
custom_validator = getattr(self, 'validate_' + f.name)
|
||||
except AttributeError, e:
|
||||
continue
|
||||
if callable(custom_validator):
|
||||
custom_validator(f)
|
||||
|
||||
def output(self):
|
||||
return ''.join([self.record_identifier] + [field.get_data() for field in self.get_sorted_fields()])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue