Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.61 KB | None | 0 0
  1. class CreateForm(forms.ModelForm):
  2.     class Meta:
  3.         model = Earth
  4.         fields = ['owner', 'year', 'cadastral_number', 'area', 'total', 'price', 'privilege', 'city', 'property', 'image',
  5.                   'notes']
  6.  
  7.         widgets = {
  8.             'owner': forms.Select(attrs={
  9.                 'class': 'form-control live-search-select2',
  10.             }),
  11.             'year': forms.NumberInput(attrs={
  12.                 'class': 'form-control',
  13.                 'type': 'number',
  14.             }),
  15.             'cadastral_number': forms.TextInput(attrs={
  16.                 'class': 'form-control',
  17.                 'type': 'text',
  18.             }),
  19.             'area': forms.NumberInput(attrs={
  20.                 'class': 'form-control',
  21.                 'type': 'number',
  22.             }),
  23.             'total': forms.NumberInput(attrs={
  24.                 'class': 'form-control',
  25.                 'type': 'number',
  26.             }),
  27.             'price': forms.NumberInput(attrs={
  28.                 'class': 'form-control',
  29.                 'type': 'number',
  30.             }),
  31.             'privilege': forms.Select(attrs={
  32.                 'class': 'form-control live-search-select2',
  33.             }),
  34.             'city': forms.Select(attrs={
  35.                 'class': 'form-control live-search-select2',
  36.             }),
  37.             'property': forms.Select(attrs={
  38.                 'class': 'form-control live-search-select2',
  39.             }),
  40.             'image': forms.ImageField(),
  41.             'notes': forms.TextInput(attrs={
  42.                 'class': 'form-control',
  43.                 'type': 'text',
  44.             })
  45.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement