Preprocessing.

        Flattens the object. Important data comes on the 'theGroup'
        dictionary inside of the response. Instead, every element of the
        'theGroup' dictionary is taken out to the main attrs dictionary.

        Notes on the group get some html tags removed.

.. todo:: use mambuutil.strip_tags() method

        A 'name' field is added, equivalent to the 'groupName' field.
        This is useful on loan accounts. They get a 'holder' field added
        somewhere, which may be an individual client, or a group. So to
        get the holder name, you just access the 'holder'['name']. No
        matter if you have a client loan or a group loan, you get the
        name of the holder.

def preprocess(self):
        """Preprocessing.

        Flattens the object. Important data comes on the 'theGroup'
        dictionary inside of the response. Instead, every element of the
        'theGroup' dictionary is taken out to the main attrs dictionary.

        Notes on the group get some html tags removed.

.. todo:: use mambuutil.strip_tags() method

        A 'name' field is added, equivalent to the 'groupName' field.
        This is useful on loan accounts. They get a 'holder' field added
        somewhere, which may be an individual client, or a group. So to
        get the holder name, you just access the 'holder'['name']. No
        matter if you have a client loan or a group loan, you get the
        name of the holder.
        """
        super(MambuGroup,self).preprocess()

        try:
            for k,v in self['theGroup'].items():
                self[k] = v
            del(self.attrs['theGroup'])
        except Exception as e:
            pass

        try:
            self['notes'] = self['notes'].replace("<div>", "").replace("</div>", "")
        except Exception as e:
            self['notes'] = ""

        try:
            self['name'] = self['groupName']
        except KeyError:
            pass