(self, app, module, langs)
Convert a Module object to a JValue representation
        with just the good parts.

        NOTE: This is not a tastypie "magic"-name method to
        dehydrate the "module" field; there is no such field.
Convert a Module object to a JValue representation
        with just the good parts.
Convert a Module object to a JValue representation with just the good parts .
def dehydrate_module(self, app, module, langs):
        """
        Convert a Module object to a JValue representation
        with just the good parts.

        NOTE: This is not a tastypie "magic"-name method to
        dehydrate the "module" field; there is no such field.
        """
        try:
            dehydrated = {}

            dehydrated['case_type'] = module.case_type

            all_case_properties = self.get_all_case_properties_local(app)
            dehydrated['case_properties'] = all_case_properties[module.case_type]

            dehydrated['unique_id'] = module.unique_id

            dehydrated['forms'] = []
            for form in module.forms:
                form_unique_id = form.unique_id
                form_jvalue = {
                    'xmlns': form.xmlns,
                    'name': form.name,
                    'questions': form.get_questions(
                        langs,
                        include_triggers=True,
                        include_groups=True,
                        include_translations=True,
                        include_fixtures=True,
                    ),
                    'unique_id': form_unique_id,
                }
                dehydrated['forms'].append(form_jvalue)
            return dehydrated
        except Exception as e:
            return {
                'error': str(e)
            }
def dehydrate_module ( self , app , module , langs ) : try : dehydrated = { } dehydrated [ 'case_type' ] = module . case_type all_case_properties = self . get_all_case_properties_local ( app ) dehydrated [ 'case_properties' ] = all_case_properties [ module . case_type ] dehydrated [ 'unique_id' ] = module . unique_id dehydrated [ 'forms' ] = [ ] for form in module . forms : form_unique_id = form . unique_id form_jvalue = { 'xmlns' : form . xmlns , 'name' : form . name , 'questions' : form . get_questions ( langs , include_triggers = True , include_groups = True , include_translations = True , include_fixtures = True , ) , 'unique_id' : form_unique_id , } dehydrated [ 'forms' ] . append ( form_jvalue ) return dehydrated except Exception as e : return { 'error' : str ( e ) }