Did I find the right examples for you? yes no

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)

src/p/o/popcorn_maker-HEAD/popcorn_gallery/reports/views.py   popcorn_maker(Download)
def report_form(request):
    if request.method == 'POST':
        form = ReportForm(request.POST)
        if form.is_valid():
            report = form.save()

src/d/i/Diaphanum-HEAD/reports/views.py   Diaphanum(Download)
    all_protocols = Protocol.objects.all()
 
    if report_form.is_valid():
        report = report_form.save()
        request.session['report_in_creation'] = formset.instance = report

src/i/n/inventory-HEAD/reports/views.py   inventory(Download)
    if request.method == 'POST':
        form = ReportForm(request.POST)
        if form.is_valid():
            search_q = Q()
            allocation = request.POST.get('allocation', '')

src/m/o/mozilla_inventory-HEAD/reports/views.py   mozilla_inventory(Download)
    if request.method == 'POST':
        form = ReportForm(request.POST)
        if form.is_valid():
            search_q = Q()
            allocation = request.POST.get('allocation', '')

src/p/o/popcorn_maker-HEAD/popcorn_gallery/reports/tests/forms_tests.py   popcorn_maker(Download)
    def test_invalid_data(self):
        data = {'url': 'random', 'description': 'Invalid'}
        form = ReportForm(data)
        eq_(form.is_valid(), False)
 
    def test_invalid_domain(self):
        data = {'url': 'http://invalid.mozillapopcorn.org/inappropriate/',
                'description': 'This is outrageous!'}
        form = ReportForm(data)
        eq_(form.is_valid(), False)
    def test_valid_data(self):
        data = {'url': 'http://test.mozillapopcorn.org/inappropriate/',
                'description': 'This is outrageous!'}
        form = ReportForm(data)
        ok_(form.is_valid())