Python django.forms.SplitDateTimeWidget() Examples

The following are 22 code examples for showing how to use django.forms.SplitDateTimeWidget(). These examples are extracted from open source projects. 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 check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module django.forms , or try the search function .

Example 1
Project: StormOnline   Author: stormsha   File: widgets.py    License: Apache License 2.0 5 votes vote down vote up
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
Project: GTDWeb   Author: lanbing510   File: widgets.py    License: GNU General Public License v2.0 5 votes vote down vote up
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
Project: bioforum   Author: reBiocoder   File: widgets.py    License: MIT License 5 votes vote down vote up
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 4
Project: weibo-analysis-system   Author: Superbsco   File: widgets.py    License: MIT License 5 votes vote down vote up
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 5
Project: myblog   Author: myminwang   File: widgets.py    License: GNU Affero General Public License v3.0 5 votes vote down vote up
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 6
Project: CTF_AWD_Platform   Author: xuchaoa   File: widgets.py    License: MIT License 5 votes vote down vote up
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 7
Project: django_OA   Author: abaoMAO   File: widgets.py    License: GNU General Public License v3.0 5 votes vote down vote up
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 8
Project: Hands-On-Application-Development-with-PyCharm   Author: PacktPublishing   File: widgets.py    License: MIT License 5 votes vote down vote up
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
Project: python   Author: Yeah-Kun   File: widgets.py    License: Apache License 2.0 5 votes vote down vote up
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
Project: openhgsenti   Author: drexly   File: widgets.py    License: Apache License 2.0 5 votes vote down vote up
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
Project: Mxonline3   Author: mtianyan   File: widgets.py    License: Apache License 2.0 5 votes vote down vote up
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
Project: python2017   Author: bpgc-cte   File: widgets.py    License: MIT License 5 votes vote down vote up
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
Project: imoocc   Author: iopsgroup   File: widgets.py    License: GNU General Public License v2.0 5 votes vote down vote up
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
Project: devops   Author: madre   File: widgets.py    License: MIT License 5 votes vote down vote up
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
Project: online   Author: myminwang   File: widgets.py    License: GNU Affero General Public License v3.0 5 votes vote down vote up
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
Project: Dailyfresh-B2C   Author: BeanWei   File: widgets.py    License: Apache License 2.0 5 votes vote down vote up
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
Project: djongo   Author: nesdis   File: test_splitdatetimewidget.py    License: GNU Affero General Public License v3.0 5 votes vote down vote up
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 18
Project: djongo   Author: nesdis   File: test_splitdatetimewidget.py    License: GNU Affero General Public License v3.0 5 votes vote down vote up
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 19
Project: djongo   Author: nesdis   File: test_splitdatetimewidget.py    License: GNU Affero General Public License v3.0 5 votes vote down vote up
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 20
Project: djongo   Author: nesdis   File: test_splitdatetimewidget.py    License: GNU Affero General Public License v3.0 5 votes vote down vote up
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 21
Project: djongo   Author: nesdis   File: test_splitdatetimewidget.py    License: GNU Affero General Public License v3.0 5 votes vote down vote up
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 22
Project: ImitationTmall_Django   Author: Liweimin0512   File: widgets.py    License: GNU General Public License v3.0 5 votes vote down vote up
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)