Нет описания

forms.py 816B

1234567891011121314151617181920212223242526
  1. from django.forms.models import inlineformset_factory, modelform_factory, modelformset_factory
  2. from django import forms
  3. from .models import SearchData
  4. from django.forms import ModelForm
  5. from django_google_maps import widgets as map_widgets
  6. from django_google_maps import fields as map_fields
  7. import django_filters
  8. GeneralWidgets = {
  9. 'startDate': forms.DateInput(format="%d/%m/%Y",attrs={'type': 'text', 'class': 'datepicker'}),
  10. 'address': map_widgets.GoogleMapsAddressWidget,
  11. 'photo': forms.FileInput,
  12. 'sub_total': forms.TextInput(attrs={'readonly': 'readonly'}),
  13. 'vat': forms.TextInput(attrs={'readonly': 'readonly'}),
  14. 'total': forms.TextInput(attrs={'readonly': 'readonly'}),
  15. }
  16. SearchForm = modelform_factory(
  17. SearchData,
  18. fields="__all__",
  19. widgets = GeneralWidgets,
  20. )