def fgPrimeDefaults(self, request, contextObject=None):
        """ primes request with default value"""

        BaseFormField.fgPrimeDefaults(self, request, contextObject)

        form_val = request.get(self.fgField.__name__, None)
        if form_val:
            self.fgField.tmp_value = form_val
        else:
            config = getMultiAdapter((self, request), name="maps_configuration")
            self.fgField.tmp_value = config.default_location
            request.form.setdefault(self.fgField.__name__, self.fgField.tmp_value)
Example #2
0
    def fgPrimeDefaults(self, request, contextObject=None):
        """ primes request with default value"""

        BaseFormField.fgPrimeDefaults(self, request, contextObject)

        form_val = request.get(self.fgField.__name__, None)
        if form_val:
            self.fgField.tmp_value = form_val
        else:
            config = getMultiAdapter((self, request),
                                     name="maps_configuration")
            self.fgField.tmp_value = config.default_location
            request.form.setdefault(self.fgField.__name__,
                                    self.fgField.tmp_value)