here is my forms.py:
from django import forms
from django.forms import DateTimeInput, DateInput
from property.models import PropertyView
class DetailForm(forms.ModelForm):
class Meta:
model = PropertyView
datepurchased = forms.DateField(input_formats=['%d/%m/%Y'])
fields = ['address1', 'address2','postcode','datepurchased']
and here is how the form appears: form with text instead of date input
You can make a custom widget:
and then plug in this custom widget