Ejemplo n.º 1
0
def commFormChoicesUpdate_ajax(request):
    """
    Given an ajax request with a region specified, send back the communicator form (in html)
    """
    cntry = request.GET['country']
    release_id = request.GET['crelid']
    release = Release.objects.get(id=release_id)
    comms = getCommForGeographyAndRelease(release, cntry)
    return HttpResponse(json.dumps([{"optionValue":x, "optionDisplay":y} for (x, y) in comms]))
Ejemplo n.º 2
0
 def __init__(self, case, *args, **kwargs):
     """Constructor"""
     super(forms.Form, self).__init__(*args, **kwargs)
     self.fields['geography'].choices = getGeographyForRelease(case.protocol.release)
     initGeog = self.fields['geography'].choices[0][0]
     self.fields['country'].choices = getCountryForGeography(case.protocol.release, initGeog)
     initCountry = self.fields['country'].choices[0][0]
     self.fields['communicator'].choices = getCommForGeographyAndRelease(case.protocol.release, initCountry)
     initComm = self.fields['communicator'].choices[0][0]
     self.fields['pg_model'].choices = getPGForGeographyAndCommAndRelease(case.protocol.release, initCountry, initComm)
     self.fields['browser'].choices = BROWSER_OPTIONS
     self.fields['owner'].choices = getOwnerUsers(team=None)
     self.fields['owner'].initial = case.owner
     self.fields['planned_for'].choices = getPlannedForChoices(case.protocol.release)
     self.fields['country_ignore'].initial = True
Ejemplo n.º 3
0
 def __init__(self, release, geog_str, *args, **kwargs):
     """Constructor"""
     super(forms.Form, self).__init__(*args, **kwargs)
     self.fields['communicator'].choices = getCommForGeographyAndRelease(release, geog_str)
     self.fields['geog_passthrough'].initial = geog_str