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

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

src/q/u/qualitio-HEAD/qualitio/require/views.py   qualitio(Download)
from qualitio import store
from qualitio.require.models import Requirement
from qualitio.require.forms import RequirementForm
 
from qualitio import history
def edit(request, requirement_id, **kwargs):
    requirement = Requirement.objects.get(pk=requirement_id)
    requirement_form = RequirementForm(instance=requirement)
    return direct_to_template(request, 'require/edit.html',
                              {'requirement_form': requirement_form})
def new(request, requirement_id, **kwargs):
    requirement = Requirement.objects.get(id=requirement_id)
    requirement_form = RequirementForm(initial={'parent': requirement})
    return direct_to_template(request, 'require/edit.html',
                              {'requirement_form': requirement_form})
def valid(request, requirement_id=0, **kwargs):
    if requirement_id:
        requirement = Requirement.objects.get(pk=requirement_id)
        requirement_form = RequirementForm(request.POST, instance=requirement)
    else:
        requirement_form = RequirementForm(request.POST)

src/q/u/qualitio-HEAD/qualitio/require/tests.py   qualitio(Download)
 
from qualitio.require.models import Requirement
from qualitio.require.forms import RequirementForm
 
 
    def configure_form_with_direct_cycle_dependency(self):
        data = {'dependencies': [self.mee_go.id, self.mee_go_TV.id]}
        return RequirementForm(data, instance=self.mee_go_Notebook)
 
    def configure_form_with_dependency_cycle(self):
        data = {'dependencies': [self.mee_go.id, self.flashlight.id]}
        return RequirementForm(data, instance=self.mee_go_Notebook)
    def configure_form_for_new_requirement_object(self):
        data = self.new_requirement_form_data()
        return RequirementForm(data)
 
 
    def configure_form(self):
        data = {'name': 'BIG PROJECT'}
        return RequirementForm(data, instance=self.big_project)