I'm looking for a solution to this basic problem: I use a jQuery plugin (datepicker) to pick users I am a date How should this be used in the Denggo Form?
A formet does not seem to be the right solution, but neither is my own widget and phone, instead of continuing to try new options, I am looking for some direction. Here is a simple test scenario
models.py
class DateTest (models.Model) :. Date_nm = models.CharField (MAX_LENGTH = 120) fromdate = models.DateTimeField () forms.py
def datetest_save_page (request): If request Method == 'post': form = dateTestSaveForm (request.POST) if form.is_valid (): date_nm, dummy = DateTest.objects.get_or_create (date_nm = form.cleaned_data ['date_nm']) fromdate = form.cleaned_data [' Return from 'HttpResponseRedirect' ('datetest_page.html') and: Form = DateTestSaveForm () Returns render_to_response ('datetest_save.html', {'form': form,}) forms. Py
class DateTestSaveForm (forms .form): date_nm = forms.CharField (label = u'Date name ', MAX_LENGTH = 30) fromdate = forms.DateTimeField () i installed my datepicker in my base Or. Html and called datetest_save.html. It calls and I can choose only one date, but I do not know which date I will choose and it will be left in my database
< In fact many jQuery plug-ins are names like "Datepicker", so it's hard to know how you are using here though, if you have a If you do not want to create custom form fields, you will need to find a library that can be used Ale date format will offer some sort of adapt. Specifically, the field value should be in the format: "YYYY-MM-DD".
If you can not or you do not want to keep the date in that format, then you will have to create a custom form field that will automatically use the date format of your chosen date format Someone will parse in something.
Comments
Post a Comment