forms.py 575 Bytes
Newer Older
Jamesie Pic's avatar
Jamesie Pic committed
1
2
3
4
5
6
7
8
9
10
from django import forms

from datetimewidget.widgets import DateWidget

from .models import Position


class PositionForm(forms.ModelForm):
    class Meta:
        model = Position
11
        fields = ['datetime', 'text', 'link', 'representative']
Jamesie Pic's avatar
Jamesie Pic committed
12
13
14
15
16
17
18
19
        widgets = {
            # Use localization and bootstrap 3
            'datetime': DateWidget(
                attrs={
                    'id': 'yourdatetimeid'
                },
                usel10n=True,
                bootstrap_version=3,
20
21
            ),
            'representative': forms.HiddenInput
Jamesie Pic's avatar
Jamesie Pic committed
22
        }