Пример #1
0
 def set_arg(self, arg, val):
     if arg == 'initial_value':
         form = self.get_form()
         ndate, ntime = self._make_widget_names()
         form.get_widget(ntime).set_arg('initial_value', val)
         form.get_widget(ndate).set_arg('initial_value', val)
     else:
         TextBox.set_arg(self, arg, val)
Пример #2
0
    def get_validation_js_info(self):
        r = TextBox.get_validation_js_info(self)
        me = 'document.getElementById("%s")' % self.get_html_id()

        return r + [{
            'msg': 'Invalid number',
            'validate': 'isNaN(%s)' % self.calljs_getvalue(),
            'onselect': me + '.focus()',
            'markitem': self.get_html_id()
        }]
Пример #3
0
    def get_calc_html_attrs(self):
        calcdict = TextBox.get_calc_html_attrs(self)

        html_id = self.get_html_id()
        calcdict['onfocus'] = ('mcw_numeric_focus("%s");' %
                               html_id) + calcdict.get('onfocus', '')
        calcdict['onblur'] = ('mcw_numeric_blur("%s");' %
                              html_id) + calcdict.get('onblur', '')
        calcdict['value'] = self._number_mac_to_human(str(self.get_value()))
        calcdict['align'] = 'right'

        return calcdict
Пример #4
0
 def get_args_spec(self):
     req, opt = TextBox.get_args_spec(self)
     return req, opt + ['separators']
Пример #5
0
 def get_validation_js_info(self):
     return TextBox.get_validation_js_info(self)
Пример #6
0
 def validate_widget(self):
     return TextBox.validate_widget(self)
Пример #7
0
 def get_args_spec(self):
     req, opt = TextBox.get_args_spec(self)
     return req + ['boxes'], opt
Пример #8
0
 def get_validation_js_info(self):
     return TextBox.get_validation_js_info(self)
Пример #9
0
 def validate_widget(self):
     return TextBox.validate_widget(self)
Пример #10
0
 def get_args_spec(self):
     req, opt = TextBox.get_args_spec(self)
     return req + ['boxes'], opt