Python django.forms.SplitDateTimeWidget() Examples
The following are 22
code examples of django.forms.SplitDateTimeWidget().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
django.forms
, or try the search function
.
Example #1
Source File: widgets.py From python2017 with MIT License | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #2
Source File: widgets.py From ImitationTmall_Django with GNU General Public License v3.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #3
Source File: test_splitdatetimewidget.py From djongo with GNU Affero General Public License v3.0 | 5 votes |
def test_constructor_different_attrs(self): html = ( '<input type="text" class="foo" value="2006-01-10" name="date_0">' '<input type="text" class="bar" value="07:30:00" name="date_1">' ) widget = SplitDateTimeWidget(date_attrs={'class': 'foo'}, time_attrs={'class': 'bar'}) self.check_html(widget, 'date', datetime(2006, 1, 10, 7, 30), html=html) widget = SplitDateTimeWidget(date_attrs={'class': 'foo'}, attrs={'class': 'bar'}) self.check_html(widget, 'date', datetime(2006, 1, 10, 7, 30), html=html) widget = SplitDateTimeWidget(time_attrs={'class': 'bar'}, attrs={'class': 'foo'}) self.check_html(widget, 'date', datetime(2006, 1, 10, 7, 30), html=html)
Example #4
Source File: test_splitdatetimewidget.py From djongo with GNU Affero General Public License v3.0 | 5 votes |
def test_constructor_attrs(self): widget = SplitDateTimeWidget(attrs={'class': 'pretty'}) self.check_html(widget, 'date', datetime(2006, 1, 10, 7, 30), html=( '<input type="text" class="pretty" value="2006-01-10" name="date_0">' '<input type="text" class="pretty" value="07:30:00" name="date_1">' ))
Example #5
Source File: test_splitdatetimewidget.py From djongo with GNU Affero General Public License v3.0 | 5 votes |
def test_formatting(self): """ Use 'date_format' and 'time_format' to change the way a value is displayed. """ widget = SplitDateTimeWidget( date_format='%d/%m/%Y', time_format='%H:%M', ) self.check_html(widget, 'date', datetime(2006, 1, 10, 7, 30), html=( '<input type="text" name="date_0" value="10/01/2006">' '<input type="text" name="date_1" value="07:30">' ))
Example #6
Source File: test_splitdatetimewidget.py From djongo with GNU Affero General Public License v3.0 | 5 votes |
def test_constructor_different_attrs(self): html = ( '<input type="text" class="foo" value="2006-01-10" name="date_0">' '<input type="text" class="bar" value="07:30:00" name="date_1">' ) widget = SplitDateTimeWidget(date_attrs={'class': 'foo'}, time_attrs={'class': 'bar'}) self.check_html(widget, 'date', datetime(2006, 1, 10, 7, 30), html=html) widget = SplitDateTimeWidget(date_attrs={'class': 'foo'}, attrs={'class': 'bar'}) self.check_html(widget, 'date', datetime(2006, 1, 10, 7, 30), html=html) widget = SplitDateTimeWidget(time_attrs={'class': 'bar'}, attrs={'class': 'foo'}) self.check_html(widget, 'date', datetime(2006, 1, 10, 7, 30), html=html)
Example #7
Source File: test_splitdatetimewidget.py From djongo with GNU Affero General Public License v3.0 | 5 votes |
def test_constructor_attrs(self): widget = SplitDateTimeWidget(attrs={'class': 'pretty'}) self.check_html(widget, 'date', datetime(2006, 1, 10, 7, 30), html=( '<input type="text" class="pretty" value="2006-01-10" name="date_0">' '<input type="text" class="pretty" value="07:30:00" name="date_1">' ))
Example #8
Source File: widgets.py From Dailyfresh-B2C with Apache License 2.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #9
Source File: widgets.py From online with GNU Affero General Public License v3.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #10
Source File: widgets.py From devops with MIT License | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #11
Source File: widgets.py From imoocc with GNU General Public License v2.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #12
Source File: widgets.py From StormOnline with Apache License 2.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #13
Source File: widgets.py From Mxonline3 with Apache License 2.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #14
Source File: widgets.py From openhgsenti with Apache License 2.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #15
Source File: widgets.py From python with Apache License 2.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #16
Source File: widgets.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #17
Source File: widgets.py From django_OA with GNU General Public License v3.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #18
Source File: widgets.py From CTF_AWD_Platform with MIT License | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #19
Source File: widgets.py From myblog with GNU Affero General Public License v3.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #20
Source File: widgets.py From weibo-analysis-system with MIT License | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #21
Source File: widgets.py From bioforum with MIT License | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
Example #22
Source File: widgets.py From GTDWeb with GNU General Public License v2.0 | 5 votes |
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)