def get(self, request, pk=None):
        if pk is None:
            default_data = {'app_page_type': CTA().get_for_names("page_text", "pageapp_text")}

            if 'parent' in request.GET and request.GET['parent'] != '0':
                default_data['parent'] = request.GET['parent']
            form = PageWAForm(initial=default_data)
                
            html = render_to_string('administration/page/page-create.html',
                                    {'form': form,},
                                    context_instance = RequestContext(request))

            response = Response(status.HTTP_200_OK, {"html": html})
            return self.render(response)
        else:
            page = get_object_or_404(request.website.pages, pk=pk)
            form = PageWAForm(instance=page)
            html = render_to_string('administration/page/page-edit.html',
                                    {'form': form, 
                                     'page': page},
                                    context_instance = RequestContext(request))
            response = Response(status.HTTP_200_OK, {"html": html})
            return self.render(response)
Return creation or edition form if pk is provided
dataset/ETHPy150Open ionyse/ionyweb/ionyweb/administration/views/page.py/PageView.get