Did I find the right examples for you? yes no

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

src/i/o/ionyweb-0.3/ionyweb/administration/views/page.py   ionyweb(Download)
from ionyweb.utils import ContentTypeAccessor as CTA
from ionyweb.plugin.models import PluginRelation
from ionyweb.page.forms import PageWAForm
from ionyweb.administration.utils import MESSAGES
from ionyweb.website.rendering import RenderingContext
            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',
        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, 
    def put(self, request, pk=None):
        post_values = self.DATA.copy()
        post_values['website'] = request.website.id
        form = PageWAForm(post_values)
        if form.is_valid():
            post_values['website'] = request.website.id
            # Creation of form
            form = PageWAForm(post_values, instance=page)
            if form.is_valid():
                page = form.save()

src/i/o/ionyweb-HEAD/ionyweb/administration/views/page.py   ionyweb(Download)
from ionyweb.utils import ContentTypeAccessor as CTA
from ionyweb.plugin.models import PluginRelation
from ionyweb.page.forms import PageWAForm
from ionyweb.administration.utils import MESSAGES
from ionyweb.website.rendering import RenderingContext
            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',
        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, 
    def put(self, request, pk=None):
        post_values = self.DATA.copy()
        post_values['website'] = request.website.id
        form = PageWAForm(post_values)
        if form.is_valid():
            post_values['website'] = request.website.id
            # Creation of form
            form = PageWAForm(post_values, instance=page)
            if form.is_valid():
                page = form.save()