Answer the question
In order to leave comments, you need to log in
Django. How to add a widget for a form where you need to enter the date?
What is: while a small database on sqlite3 and a field in it: birthdate = models.DateField(null=True)
We need to do "something beautiful". Ideally: there should be three rectangles (for the month, date and years) with inverted triangles inside, by clicking on which you can select the date of birth. You probably need jQuery. Or I don't know.
What can be read? And thanks to everyone for the replies.
Answer the question
In order to leave comments, you need to log in
This is in the standard django tools, here is a part of my code with a change in user data, the date of birth is just changing there:
views:
class UserUpdateView(LoggedInMixin, UpdateView):
model = User
context_object_name = 'user_object'
template_name = 'basics/profile_update.html'
form_class = UserUpdateForm
class UserUpdateForm(ModelForm):
class Meta:
model = User
fields = ('avatar', 'birthday', 'sex', 'first_name', 'last_name', 'email')
widgets = {
'birthday': SelectDateWidget(years=range(1940, 2014))
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question