alekam / django-month-year-widget

Django month year select field widget.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

django-month-year-widget

Django month year select field widget.

Usage

# forms.py

from django import forms
from django_month_year_widget.widgets import MonthYearWidget


class SampleForm(forms.Form):
    purchased_at = forms.CharField(widget=MonthYearWidget(attrs={"class": "select"}))
    
    class Meta:
        fields = ('__all__')
# views.py

from django.views.generic import FormView
from .forms import SampleForm


class SampleFormView(FormView):
    template_name = "index.html"
    form_class = SampleForm
# index.html

{{ form }}

About

Django month year select field widget.

License:MIT License


Languages

Language:Python 99.1%Language:HTML 0.9%