Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(4)  |  Derive(0)  |  Import(1)

src/q/u/qualitio-HEAD/qualitio/report/views.py   qualitio(Download)
from qualitio.organizations import permission_required
from qualitio.report.models import ReportDirectory, Report
from qualitio.report.forms import ReportDirectoryForm, ReportForm, ContextElementFormset
from qualitio.report.validators import ReportValidator
 
def directory_edit(request, directory_id, **kwargs):
    directory = ReportDirectory.objects.get(pk=directory_id)
    reportdirectory_form = ReportDirectoryForm(instance=directory)
    return direct_to_template(request, 'report/reportdirectory_edit.html',
                              {'reportdirectory_form': reportdirectory_form})
def directory_new(request, directory_id, **kwargs):
    directory = ReportDirectory.objects.get(pk=directory_id)
    reportdirectory_form = ReportDirectoryForm(initial={'parent': directory})
 
    return direct_to_template(request, 'report/reportdirectory_edit.html',
def directory_valid(request, directory_id=0, **kwargs):
    # TODO: should we think about permissions for valid views?
    if directory_id:
        reportdirectory = ReportDirectory.objects.get(pk=directory_id)
        reportdirectory_form = ReportDirectoryForm(request.POST,
                                                   instance=reportdirectory)
    else:
        reportdirectory_form = ReportDirectoryForm(request.POST)