def get(self, request, relation_html_id=None):
        """
        Return plugin form to create or update a plugin.

        If `relation_html_id` is not None, we get the form of
        the existing plugin,else we get an empty form
        in order to create a new plugin.

        Parameters :
          - relation_html_id : Html ID of the plugin relation,
                               e.g. 'plugin-relation-2' where
                               '2' is the PluginRelation ID.

        GET parameters : (required if `pk` is None)
          - placeholder_id : Html ID of the placeholder,
                             e.g. 'content-placeholder-1'.
          - plugin_type    : Content Type ID of the new plugin.
        """
        # ----
        # Get a form of an existing plugin
        # ----
        if relation_html_id is not None:
            # Get the ID relation
            pk = check_object_html_id(relation_html_id)[1]
            try:
                obj = PluginRelation.objects.filter(
                                        pages__website__exact=request.website,
                                        id__exact=pk)[0]
            except __HOLE__:
                raise Http404
            # Create the plugin form
            plugin = obj.content_object
            PluginFormClass = plugin.get_admin_form()
            form = PluginFormClass(instance=plugin)
            # Get the html of the form
            content = render_to_string('administration/plugin/plugin-edit.html',
                                       {'form': form,
                                        'plugin': plugin,
                                        'plugin_relation_html_id': relation_html_id},
                                       context_instance=RequestContext(request))
            response = Response(status.HTTP_200_OK, {'html': content,})
            return self.render(response)
        # ----
        # Get an empty form to create a new plugin
        # ----
        placeholder_id = request.GET.get('placeholder_id', None)
        plugin_type    = request.GET.get('plugin_type', None)

        if placeholder_id and plugin_type:
            # Check if placeholder ID is valid
            check_placeholder_html_id(placeholder_id)
            try:
                # Get class of the plugin type
                plugin_ct = CTA().get_for_pk(plugin_type)
                PluginClass = plugin_ct.model_class()                
                # Create an empty admin form
                PluginFormClass = PluginClass().get_admin_form()
                plugin_form = PluginFormClass()
                # Get html code of the form
                content = render_to_string('administration/plugin/plugin-create.html',
                                           {'form': plugin_form,
                                            'placeholder_id': placeholder_id,
                                            'plugin_type': plugin_type,},
                                           context_instance=RequestContext(request))
                response = Response(status.HTTP_200_OK, {'html': content,})
                return self.render(response)

            except ContentType.DoesNotExist:
                raise ErrorResponse(status.HTTP_400_BAD_REQUEST,
                                    {'msg': MESSAGES.get('default_error', "")})
        # Bad parameters => 400
        else:
            raise ErrorResponse(status.HTTP_400_BAD_REQUEST,
                                {'msg': MESSAGES.get('default_error', "")})
dataset/ETHPy150Open ionyse/ionyweb/ionyweb/administration/views/plugin.py/PluginView.get