field_type.py 564 Bytes
Newer Older
Theo Steininger's avatar
Theo Steininger committed
1
2
# -*- coding: utf-8 -*-

3
from nifty.domain_object import DomainObject
Theo Steininger's avatar
Theo Steininger committed
4
5


6
class FieldType(DomainObject):
Theo Steininger's avatar
Theo Steininger committed
7
8
9
10
11
12
13
14
15
16
17
18
19

    def process(self, method_name, array, inplace=True, **kwargs):
        try:
            result_array = self.__getattr__(method_name)(array,
                                                         inplace,
                                                         **kwargs)
        except AttributeError:
            if inplace:
                result_array = array
            else:
                result_array = array.copy()

        return result_array