Exemplo n.º 1
0
class Add_Form(forms.Form):
    Server_type_all = (
        (1, u'新服'),
        (2, u'推荐'),
        (3, u'火爆'),
    )
    SerAreaUid = forms.IntegerField(
        widget=widgets.NumberInput(attrs={"style": "width:220px;"}),
        error_messages={
            'required': u'id不能为空',
            'invalid': '必须输入数字'
        })
    SerAreaGroupName = forms.CharField(
        widget=widgets.TextInput(attrs={"style": "width:220px;"}),
        error_messages={'required': u'SerAreaGroupName不能为空'})
    SerAreaFormName = forms.CharField(
        widget=widgets.TextInput(attrs={"style": "width:220px;"}),
        error_messages={'required': u'SerAreaFormName不能为空'})
    Server_type = forms.IntegerField(widget=forms.widgets.Select(
        attrs={"style": "width:100px;"}, choices=Server_type_all))
    SerAreaIp = forms.CharField(
        widget=widgets.TextInput(attrs={"style": "width:220px;"}),
        error_messages={'required': u'SerAreaIp不能为空'})
    SerAreaPort = forms.IntegerField(
        widget=widgets.NumberInput(attrs={"style": "width:220px;"}),
        error_messages={
            'required': u'SerAreaPort不能为空',
            'invalid': '必须输入数字'
        })
    SerAreaPriority = forms.IntegerField(
        widget=widgets.NumberInput(attrs={"style": "width:220px;"}),
        error_messages={
            'required': u'SerAreaPriority不能为空',
            'invalid': '必须输入数字'
        })
Exemplo n.º 2
0
class BookForm(forms.Form):
    '''
	图书添加表单
	'''
    name = forms.CharField(
        max_length=32,
        min_length=2,
        widget=widgets.TextInput(attrs={
            'class': 'form-control',
            'placeholder': '书名',
            'id': 'bookname'
        }))
    publisher_year = forms.DateField(
        widget=widgets.DateInput(attrs={
            'class': 'form-control',
            'placeholder': '出版日期',
            'id': 'publisher_year'
        }), )

    price = forms.IntegerField(widget=widgets.NumberInput(
        attrs={
            'class': 'form-control',
            'placeholder': '价格',
            'id': 'price'
        }))
    stocks = forms.IntegerField(widget=widgets.NumberInput(
        attrs={
            'class': 'form-control',
            'placeholder': '库存',
            'id': 'stocks'
        }))
    status = forms.ChoiceField(
        choices=[(0, '未出版'), (1, '已出版')],
        widget=widgets.Select(attrs={
            'type': 'select',
            'id': 'status'
        }),
    )

    type = forms.ChoiceField(choices=TypeBook.objects.all().values_list(
        'id', 'type_book'),
                             widget=widgets.Select(
                                 attrs={
                                     "class": "form-control",
                                     "data-live-search": "true",
                                     "data-width": "100%",
                                     "id": "type"
                                 }))
    publisher = forms.ChoiceField(choices=Publisher.objects.all().values_list(
        'id', 'name'),
                                  widget=widgets.Select(
                                      attrs={
                                          "class": "form-control",
                                          "data-live-search": "true",
                                          "data-width": "100%",
                                          "id": "publisher"
                                      }))
    author = forms.MultipleChoiceField(
        choices=Author.objects.all().values_list('id', 'name'),
        widget=widgets.SelectMultiple(attrs={"id": "demo-cs-multiselect"}))
Exemplo n.º 3
0
Arquivo: forms.py Projeto: tp0829/BS
 class Meta:
     model = UserInfo
     fields = '__all__'
     widgets = {
         'username':
         widgets.TextInput(attrs={'class': 'form-control input-lg'}),
         'password':
         widgets.PasswordInput(attrs={'class': 'form-control input-lg'}),
         'name':
         widgets.TextInput(attrs={'class': 'form-control input-lg'}),
         'email':
         widgets.EmailInput(attrs={'class': 'form-control input-lg'}),
         'types':
         widgets.NumberInput(attrs={'class': 'form-control input-lg'}),
         'database_id':
         widgets.NumberInput(attrs={'class': 'form-control input-lg'}),
         'roles':
         widgets.Select(attrs={'class': 'form-control input-lg'}),
     }
     labels = {
         'username': '******',
         'password': '******',
         'name': '姓名',
         'email': '邮箱',
         'types': '用户类型',
         'database_id': '数据库编号',
         'roles': '角色',
     }
 def __init__(self, attrs=None):
     date_widgets = (
         widgets.NumberInput(attrs=attrs),
         widgets.NumberInput(attrs=attrs),
         widgets.NumberInput(attrs=attrs),
     )
     super().__init__(date_widgets, attrs)
Exemplo n.º 5
0
    class Meta:
        model = models.Product
        localized_fields = ('price_valid_until',)
        fields = ['name', 'description', 'gender', 'price_ht', 'discount_pct', 'quantity', 'price_valid_until',
                  'collection', 'clothe_size', 'reference', 'sku', 'in_stock', 'active', 'our_favorite', 'discounted', 'google_category']
        widgets = {
            'name': widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'Nom du produit'}),
            'description': forms.widgets.Textarea(attrs={'class': 'form-control'}),
            'gender': widgets.Select(attrs={'class': 'form-control'}),

            'sku': widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'SKU'}),
            'reference': widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'Référence'}),

            'price_ht': widgets.NumberInput(attrs={'class': 'form-control', 'placeholder': 'Prix Hors Taxe', 'min': '0'}),
            'price_valid_until': custom_widgets.DateInput(),
            'discount_pct': widgets.NumberInput(attrs={'class': 'form-control', 'placeholder': 'Nombre en %', 'min': '5'}),
            'quantity': widgets.NumberInput(attrs={'class': 'form-control', 'step': '5', 'min': '0'}),

            'clothe_size': widgets.SelectMultiple(attrs={'class': 'form-control'}),
            'collection': widgets.Select(attrs={'class': 'form-control'}),
            'google_category': widgets.Select(attrs={'class': 'form-control'}),

            'in_stock': widgets.CheckboxInput(attrs={'class': 'custom-control-input', 'id': 'in_stock'}),
            'our_favorite': widgets.CheckboxInput(attrs={'class': 'custom-control-input'}),
            'discounted': custom_widgets.CheckBoxInput(),
            'active': widgets.CheckboxInput(attrs={'class': 'custom-control-input', 'id': 'active'}),
        }
Exemplo n.º 6
0
 class Meta:
     model = Patient
     fields = [
         'category',
         'case_paper_number',
         'full_name',
         'age',
         'birth_date',
         'gender',
         'mobile_number',
         'email',
         'address_line_1',
         'address_line_2',
         'city',
         'pin_code',
         'referred_by',
     ]
     widgets = {
         # 'birth_date': widgets.Input(attrs={'autocomplete':'off'}),
         'birth_date':
         widgets.DateInput(format='%d-%m-%Y',
                           attrs={
                               'class': 'form-control',
                               'autocomplete': 'off',
                               'placeholder': 'dd-mm-yyyy'
                           }),
         'mobile_number':
         widgets.NumberInput(attrs={'type': 'number'}),
         'email':
         widgets.EmailInput(),
         'pin_code':
         widgets.NumberInput(attrs={'required': 'required'}),
     }
Exemplo n.º 7
0
    class Meta:

        MONTHS = [('', 'month of expiration'), ('January', '01 January'),
                  ('February', '02 Februrary'), ('March', '03 March'),
                  ('April', '04 April'), ('May', '05 May'),
                  ('June', '06 June'), ('July', '07 July'),
                  ('August', '08 August'), ('September', '09 September'),
                  ('October', '10 October'), ('November', '11 November'),
                  ('December', '12 December')]

        YEARS = [('', 'year of expiration'), ('2020', '20'), ('2021', '21'),
                 ('2022', '22'), ('2023', '23'), ('2024', '24'),
                 ('2025', '25'), ('2026', '26'), ('2027', '27')]

        #TODO: Taka út MONTHS og YEARS ef við ætlum ekki að nota það

        model = Payment
        fields = [
            'cardholder_name', 'card_number', 'exp_date', 'cvv', 'address',
            'house_number', 'country', 'city', 'postal_code'
        ]
        widgets = {
            'cardholder_name':
            widgets.TextInput(attrs={'class': 'form-control'}),
            'card_number':
            widgets.NumberInput(attrs={'class': 'form-control'}),
            'exp_date': widgets.TextInput(attrs={'class': 'form-control'}),
            'cvv': widgets.NumberInput(attrs={'class': 'form-control'}),
            'address': widgets.TextInput(attrs={'class': 'form-control'}),
            'house_number': widgets.TextInput(attrs={'class': 'form-control'}),
            'country': widgets.Select(attrs={'class': 'form-control'}),
            'city': widgets.TextInput(attrs={'class': 'form-control'}),
            'postal_code': widgets.TextInput(attrs={'class': 'form-control'}),
        }
Exemplo n.º 8
0
class CreateReviewForm(ModelForm):
    class Meta:
        model = Review
        fields = ['course_name', 'professor_name', 'how_easy',
                  'how_interesting', 'review_body']

    # todo: w htmlu te inputy nie maja labeli przez co chyba nie sa powiazane
    course_name = forms.ModelChoiceField(queryset=CourseName.objects.all().distinct('course_name'),
                                         widget=forms.Select(attrs={'style': 'width:100%'}))
    professor_name = forms.ModelChoiceField(queryset=Professor.objects.all(),
                                            widget=forms.Select(attrs={'style': 'width:100%'}))
    course_code = forms.CharField(widget=forms.TextInput(attrs={'style': 'width:100%'}))

    how_easy = forms.IntegerField(
        widget=widgets.NumberInput(attrs={
            'id': 'easyslider', 'type': 'range', 'step': '1',
            'onchange': 'setval(this, easyval)',
            'oninput': 'setval(this, easyval)',
            'style': 'width:100%',
        }))
    how_interesting = forms.IntegerField(
        widget=widgets.NumberInput(attrs={
            'id': 'interestslider', 'type': 'range', 'step': '1',
            'onchange': 'setval(this, interestval)',
            'oninput': 'setval(this, interestval)',
            'style': 'width:100%',
        }))
    review_body = forms.CharField(widget=forms.Textarea(attrs={'class': 'form-control', 'style': 'width:100%'}))
Exemplo n.º 9
0
 class Meta:
     model = Product
     exclude = ['id']
     widgets = {
         'name':
         widgets.TextInput(attrs={
             'class': 'form-control',
             'placeholder': 'Nafn'
         }),
         'price':
         widgets.NumberInput(attrs={
             'class': 'form-control',
             'placeholder': 'Verð/kr'
         }),
         'description':
         widgets.TextInput(attrs={
             'class': 'form-control',
             'placeholder': 'Lýsing á vöru'
         }, ),
         'quantity':
         widgets.NumberInput(attrs={'class': 'form-control'}),
         'on_sale':
         widgets.CheckboxInput(attrs={'class': 'checkbox'}),
         'category':
         forms.Select(attrs={'class': 'ProductType'}),
         'status':
         forms.Select(attrs={'class': 'ProductStatus'}),
         'sub_type':
         forms.Select(attrs={'class': 'ProductSubTypes'}),
         'age_limit':
         forms.Select(attrs={'class': 'ProductAgeLimit'}),
         'manufacturer':
         forms.Select(attrs={'class': 'ProductManufacturer'}),
     }
Exemplo n.º 10
0
class DepartmentForm(forms.Form):
    name = forms.CharField(
        label='部门名称:',
        required=True,
        max_length=120,
        error_messages={
            'required': '部门名称不能为空,请输入!',
            'max_length': '部门名称太长了!'},
        widget=widgets.TextInput(attrs={"placeholder": "请输入部门名称", "class": "form-control"}))

    leader = forms.CharField(
        label='负 责 人:',
        required=True,
        max_length=60,
        error_messages={
            'required': '负责人不能为空,请输入!',
            'max_length': '负责人名字太长了!'},
        widget=widgets.TextInput(attrs={"placeholder": "请输入负责人", "class": "form-control"}))

    phone = forms.CharField(
        label='手 机 号:',
        required=True,
        error_messages={
            'required': '手机号不能为空,请输入!'},
        widget=widgets.NumberInput(attrs={"placeholder": "请输入手机号", "class": "form-control"}))

    choice = (("集团总部", "集团总部"), ("华南区域", "华南区域"),
              ("华北区域", "华北区域"), ("华东区域", "华东区域"),)
    region = forms.CharField(
        label='所在区域:',
        initial='集团总部',
        widget=widgets.Select(choices=choice,
                              attrs={"class": "form-control"}))

    address = forms.CharField(
        required=False,
        label='办公位置:',
        max_length=200,
        widget=widgets.TextInput(attrs={"placeholder": "办公所在位置",
                                        "class": "form-control"}))

    longitude = forms.DecimalField(
        required=False,
        label='区域经度:',
        widget=widgets.NumberInput(attrs={"placeholder": "区域所在经度",
                                          "class": "form-control"}))

    latitude = forms.DecimalField(
        required=False,
        label='区域纬度:',
        widget=widgets.NumberInput(attrs={"placeholder": "区域所在纬度",
                                          "class": "form-control"}))

    # 手机号验证
    def clean_phone(self):
        phone = self.cleaned_data.get('phone')
        mobile_re = re.compile(r'^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$')
        if not mobile_re.match(phone):
            raise ValidationError('请输入正确的手机号!')
        return phone
Exemplo n.º 11
0
class DetailForm(forms.Form):
    chapter = forms.IntegerField(widget=widgets.NumberInput(attrs={
        'class': 'form-control',
        'id': 'chapter',
        'placeholder': '章节'
    }, ))
    pages = forms.IntegerField(widget=widgets.NumberInput(attrs={
        'class': 'form-control',
        'id': 'pages',
        'placeholder': '页数'
    }, ))
    words = forms.IntegerField(widget=widgets.NumberInput(attrs={
        'class': 'form-control',
        'id': 'words',
        'placeholder': '字数'
    }, ))
    contentinfo = forms.CharField(widget=widgets.Textarea(
        attrs={
            'rows': '8',
            'class': 'form-control',
            'id': 'demo-textarea-input-1',
            'placeholder': '内容简介'
        }))
    catalog = forms.CharField(widget=widgets.Textarea(
        attrs={
            'class': 'form-control',
            'id': 'demo-textarea-input-2',
            'placeholder': '目录'
        }))
    logo = forms.ImageField(widget=widgets.FileInput(
        attrs={
            'id': 'file_logo',
            "class": 'fileinput-new btn btn-primary btn-file'
        }))
Exemplo n.º 12
0
 class Meta:
   model = Member
   fields = ['nwuid', 'fname', 'mname', 'lname', 'dob', 'sex', 'city',
             'parish', 'position', 'telephone', 'email', 'salary',
             'salary_type', 'dues', 'employmentStart', 'employmentEnd',
             'unionStart', 'unionEnd', 'status', 'membership', 'bargainingStatus',
             'category', 'organization', 'branch', 'bargainingUnit', 'notes']
   widgets = {
     'nwuid': widgets.TextInput(attrs={'readonly': 'True', 'class': 'form-control', 'placeholder': 'Generated after creation'}),
     'fname': widgets.TextInput(attrs={'class': 'form-control'}),
     'mname': widgets.TextInput(attrs={'class': 'form-control'}),
     'lname': widgets.TextInput(attrs={'class': 'form-control'}),
     'dob': widgets.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
     'sex': widgets.Select(attrs={'class': 'form-control'}),
     'city': widgets.TextInput(attrs={'class': 'form-control'}),
     'parish': widgets.Select(attrs={'class': 'form-control'}),
     'position': widgets.TextInput(attrs={'class': 'form-control'}),
     'telephone': widgets.TextInput(attrs={'class': 'form-control form_telephone', 'max': '12', 'placeholder': '876-xxx-xxxx', 'type': 'tel', 'pattern': '[0-9]{3}-[0-9]{3}-[0-9]{4}'}),
     'email': widgets.EmailInput(attrs={'class': 'form-control', 'type': 'email'}),
     'salary': widgets.NumberInput(attrs={'class': 'form-control', 'style': 'width:80%;'}),
     'salary_type': widgets.Select(attrs={'class': 'form-control'}),
     'dues': widgets.NumberInput(attrs={'readonly': 'True', 'class': 'form-control', 'style': 'width:80%;'}),
     'employmentStart': widgets.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
     'employmentEnd': widgets.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
     'unionStart': widgets.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
     'unionEnd': widgets.DateInput(attrs={'class': 'form-control', 'type': 'date'}),
     'status': widgets.Select(attrs={'class': 'form-control'}),
     'membership': widgets.Select(attrs={'class': 'form-control'}),
     'bargainingStatus': widgets.Select(attrs={'class': 'form-control'}),
     'notes': widgets.Textarea(attrs={'class': 'form-control'})
   }
Exemplo n.º 13
0
    class Meta:
        model = Checkout
        #created = User.username
        exclude = {
            'created_by',
            'total_time',
            'image',
            'checkin_at',
            'layer_issues',
            'missing_objects',
            'border_issues',
            'label_by',
            'correct_by',
            'scene_type',
            'weather',
            'day_lights',
            'no_of_scooters',
            'scooter_group',
            'no_of_motorbike',
            'motorbike_group',
            'no_of_bicycle',
            'no_of_mistakes',
            'bicycle_group',
            'other_tag_issues',
            'occlusion_truncation_issues',
            'total_unique_bicycle',
            'total_unique_scooter',
            'total_unique_motorbike',
            'total_unique_objects',
        }
        dateTimeOptions = {}

        widgets = {
            # Use localization and bootstrap 3
            'image_id':
            widgets.TextInput(attrs={'class': "form-control disabled"}),
            'checkout_at':
            widgets.TextInput(attrs={
                'class': "form-control",
                'readonly': True,
            }),
            #'checkin_at': DateTimeWidget(options=dateTimeOptions,attrs={'id': "checkin_at",'class':"form-control",'placeholder':"Image Stop Time"}, usel10n=True, bootstrap_version=3),
            'image_objects':
            widgets.NumberInput(
                attrs={
                    'class': "form-control",
                    "min": "0",
                    'placeholder': "Total Objects In Image"
                }),
            'image_status':
            widgets.Select(attrs={'class': "form-control"}),
            'comment':
            widgets.TextInput(attrs={
                'class': "form-control",
                'placeholder': "Put Your Comment Here"
            }),
            'total_time':
            widgets.NumberInput(attrs={'class': "form-control"}),
        }
Exemplo n.º 14
0
 class Meta:
     model = ProductOrder
     exclude = ['id']
     widgets = {
         'quantity': widgets.NumberInput(attrs={'min': 1}),
         'order_id': widgets.NumberInput(attrs={'min': 1}),
         'product_id': widgets.NumberInput(attrs={'min': 1})
     }
Exemplo n.º 15
0
 class Meta:
     model = OrderedProducts
     exclude = ['id']
     widgets = {
         'product': widgets.TextInput(attrs={'class': 'Product'}),
         'quantity': widgets.NumberInput(attrs={'class': 'form-control'}),
         'order': widgets.NumberInput(attrs={'class': 'Order'})
     }
Exemplo n.º 16
0
 def __init__(self, attrs=None):
     """
     Initialisation of the class which defines the two date widgets (month and year) that will be used in the widget
     :param attrs: Any attributes to be passed to the individual widget definitions
     """
     date_widgets = (widgets.NumberInput(attrs=attrs),
                     widgets.NumberInput(attrs=attrs),)
     super().__init__(date_widgets, attrs)
Exemplo n.º 17
0
 def __init__(self, attrs=None):
     """
     Constructor defines both the field types to be used in the two dates
     :param attrs: Any attributes to be passed into the individual widget creation
     """
     date_widgets = (widgets.NumberInput(attrs=attrs),
                     widgets.NumberInput(attrs=attrs),)
     super().__init__(date_widgets, attrs)
Exemplo n.º 18
0
class MovePageActionForm(admin.helpers.ActionForm):
    step_widget = widgets.NumberInput(attrs={'id': 'changelist-form-step'})
    step = forms.IntegerField(required=False,
                              initial=1,
                              widget=step_widget,
                              label=False)
    page_widget = widgets.NumberInput(attrs={'id': 'changelist-form-page'})
    page = forms.IntegerField(required=False, widget=page_widget, label=False)
Exemplo n.º 19
0
 class Meta:
     model = Items
     exclude = ['ItemID', 'id_ManID_id']
     widgets = {
         'Name': widgets.TextInput(attrs={'class': 'form-control'}),
         'Description': widgets.TextInput(attrs={'class': 'form-control'}),
         'Quantity_available': widgets.NumberInput(attrs={'class': 'form-control'}),
         'Price': widgets.NumberInput(attrs={'class': 'form-control'})
     }
Exemplo n.º 20
0
 class Meta:
     model = HouseFilter
     exclude = []
     widgets = {
         'order': widgets.Select(attrs={'class': 'order'}),
         'size_low': widgets.NumberInput(attrs={'class': 'prize_low'}),
         'size_high': widgets.NumberInput(attrs={'class': 'prize_high'}),
         'price_low': widgets.NumberInput(attrs={'class': 'size_low'}),
         'price_high': widgets.NumberInput(attrs={'class': 'size_high'}),
     }
Exemplo n.º 21
0
 def get_form(self):
     '''add date picker in forms'''
     form = super(ProductCreateView, self).get_form()
     form.fields['product'].widget = widgets.Textarea(attrs={'rows': 1})
     # form.fields['unit'].widget = widgets.NumberInput(attrs={'rows': 1})
     form.fields['purchase_price'].widget = widgets.NumberInput(attrs={'rows': 1})
     form.fields['sale_price'].widget = widgets.NumberInput(attrs={'rows': 1})
     # form.fields['supplier'].widget = widgets.MultiWidget(attrs={'rows': 1})
     form.fields['description'].widget = widgets.Textarea(attrs={'rows': 2})
     return form
Exemplo n.º 22
0
 class Meta:
     model = CardInfo
     exclude = ['id']
     widgets = {
         'card_holder': widgets.TextInput(attrs={'class': 'form-control'}),
         'card_number':
         widgets.NumberInput(attrs={'class': 'form-control'}),
         'Exp_date': widgets.DateInput(attrs={'class': 'form-control'}),
         'CVC': widgets.NumberInput(attrs={'class': 'form-control'})
     }
Exemplo n.º 23
0
 class Meta:
     model = Product
     exclude = ['id']
     widgets = {
         'name': widgets.TextInput(attrs={'class': 'form-control'}),
         'quantity': widgets.NumberInput(attrs={'class': 'form-control'}),
         'price': widgets.NumberInput(attrs={'class': 'form-control'}),
         'system': widgets.Select(attrs={'class': 'form-control'}),
         'release_date': widgets.SelectDateWidget(attrs={'class': 'form-control'}),
         'shop_arrival_date': widgets.SelectDateWidget(attrs={'class': 'form-control'})
     }
Exemplo n.º 24
0
 class Meta:
     model = PaymentInfos
     exclude = {'id', 'user', 'active'}
     widgets = {
         'full_name': widgets.TextInput(attrs={'class': 'form-control'}),
         'card_number':
         widgets.NumberInput(attrs={'class': 'form-control'}),
         'exp_month': widgets.NumberInput(attrs={'class': 'form-control'}),
         'exp_year': widgets.NumberInput(attrs={'class': 'form-control'}),
         'cvv': widgets.NumberInput(attrs={'class': 'form-control'}),
     }
 class Meta:
     model = personal_info
     exclude = ['id', 'user']
     widgets = {
         'name': widgets.TextInput(attrs={'class': 'form-control'}),
         'street-name': widgets.TextInput(attrs={'class': 'form-control'}),
         'house-num': widgets.NumberInput(attrs={'class': 'form-control'}),
         'country': widgets.Select(choices=COUNTRIES),
         'city': widgets.TextInput(attrs={'class': 'form-control'}),
         'zip': widgets.NumberInput(attrs={'class': 'form-control'}),
     }
Exemplo n.º 26
0
 class Meta:
     model = Product
     exclude = ['id', 'nutriInfo']
     widgets = {
         'name': widgets.TextInput(attrs={'class': 'form-control'}),
         'manufacturer': widgets.Select(attrs={'class': 'form-control'}),
         'price': widgets.NumberInput(attrs={'class': 'form-control'}),
         'description': widgets.TextInput(attrs={'class': 'form-control'}),
         'amount': widgets.NumberInput(attrs={'class': 'form-control'}),
         'tag': widgets.Select(attrs={'class': 'form-control'}),
     }
Exemplo n.º 27
0
 class Meta:
     model = House
     exclude = ['id', 'seller']
     widgets = {
         'name': widgets.TextInput(attrs={'class': 'form-control'}),
         'description': widgets.TextInput(attrs={'class': 'form-control'}),
         'category': widgets.Select(attrs={'class': 'form-control'}),
         'size': widgets.NumberInput(attrs={'class': 'form-control'}),
         'price': widgets.NumberInput(attrs={'class': 'form-control'}),
         'on_sale': widgets.CheckboxInput(),
     }
Exemplo n.º 28
0
 class Meta:
     model = Product
     fields = ['name', 'description', 'category',
               'image', 'quantity', 'price']
     widgets = {
         'description': TinyMCE(attrs={'class': 'form-control'}),
         'name': widgets.TextInput(attrs={'class': 'form-control'}),
         'quantity': widgets.NumberInput(attrs={'class': 'form-control'}),
         'price': widgets.NumberInput(attrs={'class': 'form-control', 'min': "12"}),
         'category': widgets.Select(attrs={'class': 'form-control'})
     }
Exemplo n.º 29
0
 class Meta:
     model = Customer
     fields = [
         'user_type', 'first_name', 'last_name', 'number', 'gender',
         'econ_name', 'econ_num'
     ]
     widgets = {
         'gender': widgets.RadioSelect(),
         'number': widgets.NumberInput(attrs={'max_length': 10}),
         'econ_num': widgets.NumberInput(attrs={'max_length': 10})
     }
Exemplo n.º 30
0
 class Meta:
     model = Address
     exclude = ['id']
     widgets = {
         'street': widgets.TextInput(attrs={'class': 'form-control'}),
         'house_number':
         widgets.NumberInput(attrs={'class': 'form-control'}),
         'postal_code':
         widgets.NumberInput(attrs={'class': 'form-control'}),
         'city': widgets.TextInput(attrs={'class': 'form-control'}),
         'country': widgets.Select(attrs={'class': 'form-control'}),
     }