(self, from_module, form, to_module, rename=False)
return copy_form
The case type of the two modules conflict,
        copying (confusingly) is still allowed.
        This is intentional.
The case type of the two modules conflict,
        copying (confusingly) is still allowed.
        This is intentional.
The case type of the two modules conflict copying ( confusingly ) is still allowed . This is intentional .
def copy_form(self, from_module, form, to_module, rename=False):
        """
        The case type of the two modules conflict,
        copying (confusingly) is still allowed.
        This is intentional.

        """
        copy_source = deepcopy(form.to_json())
        # only one form can be a release notes form, so set them to False explicitly when copying
        copy_source['is_release_notes_form'] = False
        copy_source['enable_release_notes'] = False
        if 'unique_id' in copy_source:
            del copy_source['unique_id']

        if rename:
            for lang, name in copy_source['name'].items():
                with override(lang):
                    copy_source['name'][lang] = _('Copy of {name}').format(name=name)

        copy_form = to_module.add_insert_form(from_module, FormBase.wrap(copy_source))
        to_app = to_module.get_app()
        save_xform(to_app, copy_form, form.source.encode('utf-8'))

        return copy_form
def copy_form ( self , from_module , form , to_module , rename = False ) : copy_source = deepcopy ( form . to_json ( ) ) # only one form can be a release notes form, so set them to False explicitly when copying copy_source [ 'is_release_notes_form' ] = False copy_source [ 'enable_release_notes' ] = False if 'unique_id' in copy_source : del copy_source [ 'unique_id' ] if rename : for lang , name in copy_source [ 'name' ] . items ( ) : with override ( lang ) : copy_source [ 'name' ] [ lang ] = _ ( 'Copy of {name}' ) . format ( name = name ) copy_form = to_module . add_insert_form ( from_module , FormBase . wrap ( copy_source ) ) to_app = to_module . get_app ( ) save_xform ( to_app , copy_form , form . source . encode ( 'utf-8' ) ) return copy_form