Exemple #1
0
 class Meta:
     model = Ms_asset
     widgets = {
         'life_time': EnclosedInput(append='thn', attrs={'class': 'input-medium'}),
         'price': EnclosedInput( prepend='Rp.', attrs={'class': 'input-medium'}),
         'salvage': EnclosedInput( prepend='Rp.', attrs={'class': 'input-medium'}),
         }
Exemple #2
0
class JobSchedulingForm(forms.Form):
    next_start = forms.SplitDateTimeField(label=_('Next start'),
                                          widget=SuitSplitDateTimeWidget)
    repeat = forms.IntegerField(label=_('Repeat'),
                                widget=EnclosedInput(append='min'))
    timeout = forms.IntegerField(label=_('Timeout'),
                                 widget=EnclosedInput(append='min'))
Exemple #3
0
 class Meta:
     widgets = {
         'area': EnclosedInput(prepend='icon-globe', append='km<sup>2</sup>',
                               attrs={'class': 'input-small'}),
         'population': EnclosedInput(append='icon-user',
                                     attrs={'class': 'input-small'}),
     }
Exemple #4
0
 class Meta:
     widgets = {
         'number':
         TextInput(attrs={'class': 'input-mini'}),
         'title':
         TextInput(attrs={'class': 'input-xxlarge'}),
         'content':
         AutosizedTextarea(attrs={'class': 'input-xxlarge'}),
         'location':
         TextInput(attrs={'class': 'input-xlarge'}),
         'username':
         EnclosedInput(append='icon-user', attrs={'class': 'input-small'}),
         'mobile':
         TextInput(attrs={'class': 'input-small'}),
         'email':
         EnclosedInput(append='icon-envelope',
                       attrs={'class': 'input-medium'}),
         'disapprove_info':
         AutosizedTextarea(attrs={'class': 'input-xxlarge'}),
         'note':
         AutosizedTextarea(attrs={'class': 'input-xxlarge'}),
         'tags':
         TagWidget(attrs={'class': 'input-xxlarge'}),
     }
     help_texts = {
         'tags': '使用逗號分隔多個標籤',
     }
Exemple #5
0
 class Meta:
     widgets = {
         'description':
         RedactorWidget(
             editor_options={
                 'lang':
                 'en',
                 'buttons': [
                     'html', '|', 'formatting', '|', 'bold', 'italic', '|',
                     'unorderedlist', 'orderedlist', 'outdent', 'indent',
                     'alignment', 'horizontalrule', 'underline'
                 ],
                 'imageUpload':
                 '/clients/redactor/image/'
             }),
         'balance':
         NumberInput(attrs={'min': '0'}),
         'balance':
         EnclosedInput(prepend='$'),
         'location':
         EnclosedInput(append='icon-map-marker'),
         'vat':
         EnclosedInput(append='%'),
         'shop_email':
         EnclosedInput(prepend='icon-envelope'),
         'logo':
         AdminImageWidget(),
     }
Exemple #6
0
 class Meta:
     widgets = {
         'capacity': EnclosedInput(append='ml',
                                   attrs={'class': 'input-small'}),
         'height': EnclosedInput(append='mm',
                                 attrs={'class': 'input-small'}),
         'weight': EnclosedInput(append='gr',
                                 attrs={'class': 'input-small'}),
         'diameter': EnclosedInput(append='mm',
                                   attrs={'class': 'input-small'}),
     }
Exemple #7
0
 class Meta:
     widgets = {
         'status_description':
         RedactorWidget(
             editor_options={
                 'lang':
                 'en',
                 'buttons': [
                     'html', '|', 'formatting', '|', 'bold', 'italic', '|',
                     'unorderedlist', 'orderedlist', 'outdent', 'indent',
                     'alignment', 'horizontalrule', 'underline', '|',
                     'image', '|'
                 ],
                 'imageUpload':
                 '/clients/redactor/image/',
                 'toolbarOverflow':
                 True,
             }),
         'todo_description':
         RedactorWidget(
             editor_options={
                 'lang':
                 'en',
                 'buttons': [
                     'html', '|', 'formatting', '|', 'bold', 'italic', '|',
                     'unorderedlist', 'orderedlist', 'outdent', 'indent',
                     'alignment', 'horizontalrule', 'underline', '|',
                     'image', '|'
                 ],
                 'imageUpload':
                 '/clients/redactor/image/',
                 'toolbarOverflow':
                 True,
             }),
         'amount':
         NumberInput(attrs={'min': '0'}),
         'amount':
         EnclosedInput(prepend='$'),
         'email':
         EnclosedInput(prepend='icon-envelope'),
         'delivered_at':
         SuitSplitDateTimeWidget,
         'brand':
         Select2Widget(select2_options={'width': '220px'}),
         'model':
         SfWidget(app_name='phone',
                  model_name='model',
                  chain_field='brand',
                  model_field='brand',
                  show_all=False,
                  auto_choose=False,
                  attrs={'class': 'form-control'},
                  select2_options={"width": "220px"}),
     }
Exemple #8
0
 class Meta:
     model = Employee
     widgets = {
         #'address': AutosizedTextarea(attrs={'rows': '3'}),
         'weight':
         EnclosedInput(prepend='kg',
                       append='kg',
                       attrs={'class': 'input-medium'}),
         'high':
         EnclosedInput(prepend='cm',
                       append='cm',
                       attrs={'class': 'input-medium'}),
     }
Exemple #9
0
 class Meta:
     widgets = {
         'limit':
         NumberInput(attrs={'class': 'input-mini'}),
         'path':
         EnclosedInput(prepend='icon-folder-open'),
         'url':
         EnclosedInput(prepend='icon-globe'),
         'import_rows':
         AutosizedTextarea(attrs={
             'rows': 1,
             'class': 'input-xlarge'
         }),
     }
Exemple #10
0
 class Meta:
     widgets = {
         # 'code': TextInput(attrs={'class': 'input-mini'}),
         # 'independence_day': SuitDateWidget,
         'area': EnclosedInput(prepend='fa-globe', append='km<sup>2</sup>',
                               attrs={'placeholder': 'Country area'}),
         'population': EnclosedInput(
             prepend='fa-users',
             append='<button class="btn btn-secondary" type="button" '
                    'onclick="window.open(\'https://www.google.com/\')">Search</button>',
             append_class='btn', attrs={'placeholder': 'Human population'}),
         'description': AutosizedTextarea,
         'architecture': AutosizedTextarea,
     }
Exemple #11
0
 class Meta:
     model = City
     widgets = {
         'area':
         EnclosedInput(prepend='icon-globe',
                       append='km<sup>2</sup>',
                       attrs={'class': 'input-small'}),
         'population':
         EnclosedInput(prepend='icon-user',
                       append='<input type="button" '
                       'class="btn" onclick="window'
                       '.open(\'https://www.google'
                       '.com/\')" value="Search">',
                       attrs={'class': 'input-small'}),
     }
Exemple #12
0
 class Meta:
     widgets = {
         'code': TextInput(attrs={'class': 'input-mini'}),
         'independence_day': SuitDateWidget,
         'area': EnclosedInput(prepend='icon-globe', append='km<sup>2</sup>',
                               attrs={'class': 'input-small'}),
         'population': EnclosedInput(prepend='icon-user',
                                     append='<input type="button" '
                                            'class="btn" onclick="window'
                                            '.open(\'https://www.google'
                                            '.com/\')" value="Search">',
                                     attrs={'class': 'input-small'}),
         'description': AutosizedTextarea,
         'architecture': AutosizedTextarea(attrs={'class': 'span5'}),
     }
Exemple #13
0
    class Meta:
        widgets = {
            'multiple2': TextInput(attrs={'class': 'input-small'}),
            'date': AdminDateWidget(attrs={'class': 'vDateField input-small'}),
            'date_widget': SuitDateWidget,
            'datetime_widget': SuitSplitDateTimeWidget,
            'textfield': AutosizedTextarea(attrs={'rows': '2'}),
            'linked_foreign_key': LinkedSelect,

            'enclosed1': EnclosedInput(append='icon-plane',
                                       attrs={'class': 'input-medium'}),
            'enclosed2': EnclosedInput(prepend='icon-envelope',
                                       append='<input type="button" '
                                              'class="btn" value="Send">',
                                       attrs={'class': 'input-medium'}),
        }
Exemple #14
0
 class Meta:
     model = Allownet
     fields = '__all__'
     widgets = {
         'name':
         EnclosedInput(prepend='icon-user', attrs={'class':
                                                   'input-medium'}),
         'dept':
         LinkedSelect,
         'num':
         EnclosedInput(prepend='icon-list-alt',
                       attrs={'class': 'input-medium'}),
         'qq':
         EnclosedInput(prepend='icon-comment',
                       attrs={'class': 'input-medium'}),
     }
Exemple #15
0
 class Meta:
     model = Currency
     widgets = {
         'code':
         EnclosedInput(prepend='icon-barcode',
                       attrs={'class': 'input-small'}),
         'rate':
         EnclosedInput(prepend='icon-asterisk',
                       attrs={'class': 'input-small'}),
         'pre_symbol':
         EnclosedInput(prepend='icon-chevron-left',
                       attrs={'class': 'input-small'}),
         'post_symbol':
         EnclosedInput(prepend='icon-chevron-right',
                       attrs={'class': 'input-small'}),
     }
Exemple #16
0
 class Meta:
     widgets = {
         'name': widgets.TextInput(attrs={'class': 'input-small'}),
         'new_name': widgets.TextInput(attrs={'class': 'input-small'}),
         'default': EnclosedInput(attrs={'class': 'input-mini'}),
         'data_type': widgets.Select(attrs={'class': 'input-small'}),
     }
Exemple #17
0
 class Meta:
     model = Periodic_Increase_Decree
     widgets = {
         #'address': AutosizedTextarea(attrs={'rows': '3'}),
         'working_life':
         EnclosedInput(append='Tahun', attrs={'class': 'input-medium'}),
     }
Exemple #18
0
 class Meta:
     model = models.OrderDetail
     fields = ('number', 'order', 'part', 'quantity')
     widgets = {
         'part': LinkedSelect,
         'quantity': EnclosedInput(prepend='#'),
     }
Exemple #19
0
 class Meta:
     widgets = {
         'name': widgets.TextInput(attrs={'class': 'input-small'}),
         'default': EnclosedInput(attrs={'class': 'input-mini'}),
         'data_type': widgets.Select(attrs={'class': 'input-small'}),
         'skip_regex': AutosizedTextarea(attrs={'rows': 3, 'class': 'input-small'}),
         'import_regex': AutosizedTextarea(attrs={'rows': 3, 'class': 'input-small'}),
     }
Exemple #20
0
 class Meta:
     widgets = {
         'popup_template':
         AutosizedTextarea(attrs={
             'rows': 20,
             'class': 'input-xlarge'
         }),
         'marker_template':
         AutosizedTextarea(attrs={
             'rows': 20,
             'class': 'input-xlarge'
         }),
         'limit':
         NumberInput(attrs={'class': 'input-mini'}),
         'path':
         EnclosedInput(prepend='icon-folder-open'),
         'url':
         EnclosedInput(prepend='icon-globe'),
     }
Exemple #21
0
class BaseDashboardForm(forms.Form):
    todo = forms.CharField(
        widget=forms.TextInput(attrs={"class": "form-control"}))
    date = forms.DateField(
        widget=DateTimePicker(options={"format": "YYYY-MM-DD",
                                       "pickTime": False}))
    reminder = forms.DateTimeField(
        required=False,
        widget=DateTimePicker(options={"format": "YYYY-MM-DD HH:mm",
                                       "pickSeconds": False}))
    # inlines = (FridgeInline)

    data = {'subject': 'hello',
             'message': 'Hi there'}


    widgets = {
        'area': EnclosedInput(prepend='icon-globe', append='km<sup>2</sup>',
                              attrs={'class': 'input-small'}),
        'population': EnclosedInput(append='icon-user',
                                    attrs={'class': 'input-small'}),
    }

    def __init__(self,request, *args, **kwargs):
        print('BaseDashboardForm__init__ :')
        super(BaseDashboardForm, self).__init__(*args, **kwargs)

    def clean(self):
        print('\nBaseDashboardForm self.changed_data',self.changed_data)
        cleaned_data = super(BaseDashboardForm, self).clean()
        return cleaned_data

    def custom_signup(self, request, user):
        custom_form = super(BaseDashboardForm, self)
        if hasattr(custom_form, 'signup') and callable(custom_form.signup):
            custom_form.signup(request, user)
        else:
            warnings.warn("The custom signup form must offer"
                          " a `def signup(self, request, user)` method",
                          DeprecationWarning)
            # Historically, it was called .save, but this is confusing
            # in case of ModelForm
            custom_form.save(user)
Exemple #22
0
    class Meta:
        model = Events
        fields = (
            'title',
            'dateStart',
            'dateEnd',
        )

        widgets = {
            'title': EnclosedInput(prepend='№', append='fa-home', attrs={'placeholder': 'квартира'}),
        }
Exemple #23
0
 class Meta:
     widgets = {
         'name': TextInput(attrs={'class': 'input-mini'}),
         'sequence': NumberInput(attrs={'class': 'input-mini'}),
         'callRecordSize': EnclosedInput(append='byte'),
         'ldapCIPSize': EnclosedInput(append='byte'),
         'sessionCIPSize': EnclosedInput(append='byte'),
         'otherCIPSize': EnclosedInput(append='byte'),
         'cpuCostForNormalAMA': EnclosedInput(append='ms'),
         'cPUCostForMultipleAMA': EnclosedInput(append='ms'),
         'amaSizePerBlock': EnclosedInput(append='byte'),
     }
Exemple #24
0
 class Meta:
     model = Zones
     fields = '__all__'
     widgets = {
         'zone':
         EnclosedInput(prepend='icon-globe',
                       attrs={
                           'class': 'input-medium',
                           'style': 'width: 180px'
                       }),
         'desc':
         AutosizedTextarea(attrs={
             'class': 'input-medium',
             'rows': 2,
             'style': 'width:35%'
         }),
     }
Exemple #25
0
 class Meta:
     model = Wireless
     fields = '__all__'
     widgets = {
         'fortime':
         SuitDateWidget,
         'desc':
         AutosizedTextarea(attrs={
             'class': 'input-medium',
             'rows': 2,
             'style': 'width:35%'
         }),
         'name':
         EnclosedInput(prepend='icon-user', attrs={'class':
                                                   'input-medium'}),
         'dept':
         LinkedSelect,
     }
Exemple #26
0
 class Meta:
     widgets = {
         'capacity': EnclosedInput(append='ml',
                                   attrs={'class': 'input-small'}),
         'height': EnclosedInput(append='mm',
                                 attrs={'class': 'input-small'}),
         'quantity': EnclosedInput(attrs={'class': 'input-small'}),
         'price': EnclosedInput(attrs={'class': 'input-large'}),
         'weight': EnclosedInput(append='gr',
                                 attrs={'class': 'input-small'}),
         'diameter': EnclosedInput(append='mm',
                                   attrs={'class': 'input-small'}),
         'color': Select(attrs={'class': 'input-medium'}),
     }
Exemple #27
0
 class Meta:
     widgets = {
         'image':
         AdminImageWidget(),
         'description':
         RedactorWidget(
             editor_options={
                 'lang':
                 'en',
                 'buttons': [
                     'html', '|', 'formatting', '|', 'bold', 'italic', '|',
                     'unorderedlist', 'orderedlist', 'outdent', 'indent',
                     'alignment', 'horizontalrule', 'underline', '|',
                     'image', '|', 'link'
                 ],
                 'imageUpload':
                 '/clients/redactor/image/',
             }),
         'price':
         NumberInput(attrs={'min': '0'}),
         'price':
         EnclosedInput(prepend='$'),
         'brand':
         Select2Widget(select2_options={'width': '220px'}),
         'model':
         SfWidget(app_name='phone',
                  model_name='model',
                  chain_field='brand',
                  model_field='brand',
                  show_all=False,
                  auto_choose=False,
                  attrs={'class': 'form-control'},
                  select2_options={"width": "220px"}),
         'type':
         Select2Widget(select2_options={'width': '220px'}),
     }
Exemple #28
0
 class Meta:
     widgets = {
         'price': EnclosedInput(append=u'руб.'),
         'comment': AutosizedTextarea,
         'sale_comment': AutosizedTextarea,
     }
Exemple #29
0
 class Meta:
     model = models.Part
     fields = ('number', 'name', 'price', 'quantity')
     widgets = {
         'price': EnclosedInput(prepend='RD$', append='.00'),
     }
Exemple #30
0
 def test_EnclosedInput_as_html(self):
     inp = EnclosedInput(prepend='<em>p</em>', append='<em>a</em>')
     output = self.render_enclosed_widget(inp)
     result = ('<em>p</em>', '<em>a</em>')
     self.assertHTMLEqual(output, self.get_enclosed_widget_html(result))