Here are the examples of the python api django.forms.BaseForm taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
3
View Complete Implementation : filter.py
Copyright MIT License
Author : silentsokolov
Copyright MIT License
Author : silentsokolov
def _get_form_clast(self):
fields = self._get_form_fields()
form_clast = type(
str('DateRangeForm'),
(forms.BaseForm,),
{'base_fields': fields}
)
form_clast.media = self._get_media()
# lines below ensure that the js static files are loaded just once
# even if there is more than one DateRangeFilter in use
request_key = 'DJANGO_RANGEFILTER_ADMIN_JS_SET'
if (getattr(self.request, request_key, False)):
form_clast.js = []
else:
setattr(self.request, request_key, True)
form_clast.js = self.get_js()
return form_clast