Exemple #1
0
 class Meta(object):
     model = Produtos
     exclude = []
     widgets = {
         'preco':
         NumberInput(
             attrs={
                 'class': 'input-small text-right',
                 'placeholder': '0,00',
                 'step': '0.01',
                 'min': '0.01',
             }),
         'preco_venda':
         NumberInput(
             attrs={
                 'class': 'input-small text-right',
                 'placeholder': '0,00',
                 'step': '0.01',
                 'min': '0.01',
             }),
         'descricao':
         AutosizedTextarea(attrs={
             'rows': 5,
             'class': 'input-xxlarge',
             'placeholder': '...'
         }),
     }
Exemple #2
0
 class Meta(object):
     widgets = {
         'total':
         NumberInput(
             attrs={
                 'readonly': 'readonly',
                 'class': 'input-small text-right',
                 'placeholder': '0,00'
             }),
         'desconto':
         NumberInput(
             attrs={
                 'class': 'input-small text-right desconto',
                 'placeholder': '0%',
                 'min': '0',
                 'max': '100',
                 'title': 'Informe porcentagem entre 0% e 100%.',
                 'oninvalid':
                 "this.setCustomValidity('Desconto inválido.')",
                 'oninput': "this.setCustomValidity('')"
             }),
         'observacao':
         AutosizedTextarea(attrs={
             'rows': 5,
             'class': 'input-xxlarge',
             'placeholder': '...'
         }),
         'status':
         CheckboxInput(attrs={'class': 'status-compra'}),
     }
Exemple #3
0
	class Meta:
		model = Vivienda
		fields = (
			'tipovivienda',
            'nombrevivienda',
            'piso',
            'apartamento',
            'tipovia',
            'nombrevia',
            'tipolocalidad',
            'nombrelocalidad',
            'metroscuadrados',
            'numerohabitaciones',
            'numerobanos',
            'condicionfisica',
            'zona',
		)
		widgets = {
			'tipovivienda': Select(attrs={'class':'form-control input-sm'}),
            'nombrevivienda': TextInput(attrs={'class':'form-control input-sm'}),
            'piso': TextInput(attrs={'class':'form-control input-sm'}),
            'apartamento': TextInput(attrs={'class':'form-control input-sm'}),
            'tipovia': Select(attrs={'class':'form-control input-sm'}),
            'nombrevia': TextInput(attrs={'class':'form-control input-sm'}),
            'tipolocalidad': Select(attrs={'class':'form-control input-sm'}),
            'nombrelocalidad': TextInput(attrs={'class':'form-control input-sm'}),
            'metroscuadrados': NumberInput(attrs={'class':'form-control input-sm'}),
            'numerohabitaciones': NumberInput(attrs={'class':'form-control input-sm'}),
            'numerobanos': NumberInput(attrs={'class':'form-control input-sm'}),
            'condicionfisica': Select(attrs={'class':'form-control input-sm'}),
            'zona': HiddenInput(),
            'nombrehogar': TextInput(attrs={'class':'form-control input-sm'}),
        }
Exemple #4
0
 class Meta:
     model = MantPreventivoOT
     fields = '__all__'
     widgets = {
         'maquina': LinkedSelect,
         'prev': LinkedSelect,
         'fecha': SuitDateWidget,
         'horas': NumberInput(attrs={'class': 'input-mini'}),
         'tiempo': NumberInput(attrs={'class': 'input-mini'}),
     }
Exemple #5
0
 class Meta(object):
     model = Recebimento
     exclude = []
     widgets = {
         'data': DateTimeLabelWidget(),
         'valor': NumberInput(attrs={'class': 'input-small text-right', 'placeholder': '0,00', 'step': '0.01'}),
         'juros': NumberInput(attrs={'readonly': 'readonly', 'class': 'input-small text-right', 'placeholder': '0,00', 'step': '0.01'}),
         'multa': NumberInput(attrs={'readonly': 'readonly', 'class': 'input-small text-right', 'placeholder': '0,00', 'step': '0.01'}),
         'desconto': NumberInput(attrs={'class': 'input-small text-right', 'placeholder': '0,00', 'step': '0.01'}),
         'parcelas_contas_receber': NumberInput(attrs={'readonly': 'readonly', 'class': 'input-small'}),
         'observacao': Textarea(attrs={'rows': 1, 'cols': 100}),
     }
Exemple #6
0
 class Meta:
     model = Salida
     fields = '__all__'
     widgets = {
         'fecha': SuitDateWidget,
         'material': LinkedSelect,
         'cantidad': NumberInput(attrs={'class': 'input-mini'}),
         'unidad': Select(attrs={'class': 'input-small'}),
         'receptor': Select(attrs={'class': 'input-medium'}),
         'maquina': LinkedSelect,
         'horas': NumberInput(attrs={'class': 'input-small'}),
     }
Exemple #7
0
 class Meta:
     model = MantPreventivo
     fields = '__all__'
     widgets = {
         'maquina': LinkedSelect,
         'ndate': SuitDateWidget,
         'ldate': SuitDateWidget,
         'nhours': NumberInput(attrs={'class': 'input-mini'}),
         'lhours': NumberInput(attrs={'class': 'input-mini'}),
         'lapso': NumberInput(attrs={'class': 'input-mini'}),
         'intervalo': Select(attrs={'class': 'input-small'}),
         'status': Select(attrs={'class': 'input-small'}),
     }
Exemple #8
0
 class Meta(object):
     widgets = {
         'juros': NumberInput(
             attrs={ 'placeholder': '0%', 
                     'min': '0',
                     'max': '100',
                     'step': '0.0001'
             }),
         'multa': NumberInput(
             attrs={ 'placeholder': '0%', 
                     'min': '0',
                     'max': '100',
                     'step': '0.0001'
             }),
     }
Exemple #9
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 #10
0
 class Meta:
     widgets = {
         'limit':
         NumberInput(attrs={'class': 'input-mini'}),
         'path':
         EnclosedInput(prepend='icon-folder-open'),
         'url':
         EnclosedInput(prepend='icon-globe'),
         'sheet':
         NumberInput(attrs={'class': 'input-mini'}),
         'import_rows':
         AutosizedTextarea(attrs={
             'rows': 1,
             'class': 'input-xlarge'
         }),
     }
Exemple #11
0
 class Meta:
     model = MaterialMaquina
     fields = '__all__'
     widgets = {
         'material': LinkedSelect,
         'cantidad': NumberInput(attrs={'class': 'input-mini'}),
     }
Exemple #12
0
 class Meta:
     model = MaterialMantenimiento
     fields = '__all__'
     widgets = {
         'materiales': LinkedSelect,
         'cantidad': NumberInput(attrs={'class': 'input-mini'}),
         'unidad': Select(attrs={'class': 'input-small'}),
     }
Exemple #13
0
 class Meta:
     model = Ship
     fields = '__all__'
     widgets = {
         'beam': TextInput(attrs={'class': 'input-mini'}),
         'dwt': NumberInput(attrs={'class': 'input-mini'}),
         # 'built': SuitSplitDateTimeWidget,
     }
Exemple #14
0
 class Meta:
     model = CerrarOt
     fields = '__all__'
     widgets = {
         'fin': SuitSplitDateTimeWidget,
         'inicio': SuitSplitDateTimeWidget,
         'cierre': SuitDateWidget,
         'tiempo': NumberInput(attrs={'class': 'input-mini'}),
     }
 class Meta:
     model = CourseModule
     fields = ('start', 'number_of_days', 'type')
     widgets = {
         'start': SuitDateWidget,
         'number_of_days': NumberInput(attrs={
             'min': 1,
             'max': 2
         }),
     }
Exemple #16
0
    class Meta:

        widgets = {
            'title':
            TextInput(attrs={'class': 'input-xxlarge'}),
            'likes':
            NumberInput(attrs={'class': 'input-mini'}),
            'dislikes':
            NumberInput(attrs={'class': 'input-mini'}),
            'read_num':
            NumberInput(attrs={'class': 'input-mini'}),
            'comment_num':
            NumberInput(attrs={'class': 'input-mini'}),
            'excerpt':
            AutosizedTextarea(attrs={
                'rows': 3,
                'class': 'input-xlarge'
            })
        }
Exemple #17
0
 class Meta(object):
     widgets = {
         'data': SuitSplitDateTimeWidget,
         'valor_total': NumberInput(
             attrs={ 'class': 'input-small text-right', 
                     'placeholder': '0,00', 
                     'step': '0.01',
                     'min': '0.01',
         }),
         'descricao': AutosizedTextarea(attrs={'rows': 5, 'class': 'input-xxlarge', 'placeholder': '...'}),
     }
Exemple #18
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 #19
0
 class Meta(object):
     widgets = {
         'quantidade':
         NumberInput(
             attrs={
                 'readonly': 'readonly',
                 'class': 'input-mini quantidade-ic',
                 'placeholder': '0',
                 'min': '0'
             }),
         'valor_unitario':
         NumberInput(
             attrs={
                 'readonly': 'readonly',
                 'class': 'input-small text-right valor-unitario-ic',
                 'step': '0.01'
             }),
         'desconto':
         NumberInput(
             attrs={
                 'readonly': 'readonly',
                 'class': 'input-small text-right desconto',
                 'placeholder': '0%',
                 'min': '0',
                 'max': '100',
                 'title': 'Informe porcentagem entre 0% e 100%.',
                 'oninvalid':
                 "this.setCustomValidity('Desconto inválido.')",
                 'oninput': "this.setCustomValidity('')"
             }),
         'valor_total':
         NumberInput(
             attrs={
                 'readonly': 'readonly',
                 'class': 'input-small text-right valor-total-ic',
                 'placeholder': '0,00',
                 'step': '0.01'
             }),
     }
Exemple #20
0
 class Meta(object):
     widgets = {
         'email_abertura_caixa':
         RedactorWidget(
             editor_options={
                 'lang': 'pt_br',
                 'buttons':
                 ['html', '|', 'formatting', '|', 'bold', 'italic']
             }),
         'periodo_venc_pedido_compra':
         NumberInput(attrs={
             'class': 'input-medium',
             'placeholder': '0',
             'min': '0'
         }),
         'periodo_venc_pedido_venda':
         NumberInput(attrs={
             'class': 'input-medium',
             'placeholder': '0',
             'min': '0'
         }),
         'quantidade_inlines_venda':
         NumberInput(attrs={
             'class': 'input-medium',
             'placeholder': '0',
             'min': '0'
         }),
         'quantidade_inlines_compra':
         NumberInput(attrs={
             'class': 'input-medium',
             'placeholder': '0',
             'min': '0'
         }),
         'intervalo_dias_entrega_venda':
         NumberInput(attrs={
             'class': 'input-medium',
             'placeholder': '0',
             'min': '0'
         }),
         'qtde_minima_produtos_em_estoque':
         NumberInput(attrs={
             'class': 'input-medium',
             'placeholder': '0',
             'min': '0'
         }),
         'perc_valor_minimo_recebimento':
         NumberInput(attrs={
             'class': 'input-medium',
             'placeholder': '0%',
             'min': '0'
         }),
     }
Exemple #21
0
 class Meta:
     widgets = {
         'title':
         TextInput(attrs={'class': 'input-mini'}),
         'send_times':
         NumberInput(attrs={'class': 'input-mini'}),
         'content':
         AutosizedTextarea(attrs={
             'rows': 3,
             'class': 'input-xlarge'
         }),
         'created_at':
         SuitSplitDateTimeWidget,
         'updated_at':
         SuitSplitDateTimeWidget,
         # 'retry_times': EnclosedInput(append='次'),
     }
Exemple #22
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'),
     }
class FieldDefinitionInlineFormAdmin(forms.ModelForm):
    order = forms.IntegerField(
        widget=NumberInput(attrs={'class': 'hide input-mini suit-sortable'}),
        label=u'порядок')

    def __init__(self, *args, **kwargs):
        instance = kwargs.get('instance', None)
        if instance:
            initial = kwargs.get('initial', {})
            initial.update({'order': getattr(instance, 'order', 0)})
            kwargs['initial'] = initial
        super(FieldDefinitionInlineFormAdmin, self).__init__(*args, **kwargs)

    def save(self, commit=True):
        instance = super(FieldDefinitionInlineFormAdmin, self).save(commit)
        o, o_created = ModelDefFieldOrder.objects.get_or_create(
            md=instance.model_def, field=instance)
        o.order = self.cleaned_data['order']
        o.save()
        return instance
Exemple #24
0
 class Meta(object):
     model = Funcionario
     exclude = []
     widgets = {
         'salario':
         NumberInput(
             attrs={
                 'class': 'input-small text-right',
                 'placeholder': '0,00',
                 'step': '0.01',
                 'min': '0.01',
             }),
         'data_nasc':
         SuitDateWidget,
         'observacao':
         AutosizedTextarea(attrs={
             'rows': 5,
             'class': 'input-xxlarge',
             'placeholder': '...'
         }),
         'numero':
         TextInput(attrs={'class': 'input-mini'}),
     }
Exemple #25
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 #26
0
 class Meta:
     widgets = {
         'order': NumberInput(
             attrs={'class': 'hide input-mini suit-sortable'})
     }
Exemple #27
0
 def test_NumberInput(self):
     inp = NumberInput()
     self.assertEqual('number', inp.input_type)
Exemple #28
0
 class Meta:
     widgets = {
         'weight': NumberInput(attrs={'class': 'input-mini'}),
     }
Exemple #29
0
 class Meta:
     widgets = {
         'sheet': NumberInput(attrs={'class': 'input-mini'}),
         'import_rows': AutosizedTextarea(attrs={'rows': 1, 'class': 'input-xlarge'}),
     }
Exemple #30
0
 class Meta:
     widgets = {
         'description': AutosizedTextarea(attrs={'rows': 3, 'class': 'input-xlarge'}),
         'limit': NumberInput(attrs={'class': 'input-mini'}),
     }