Sets default values for month/year at Usage Form in overview page
Fixes bug 931227. The problem is with using 'initial' values for
a bound form. These are mutually exclusive.
Another solution is to use only unbound form,
with setting:
forms.DateForm(initial={'month':
self.request.GET.get('month', self.today.month,..)
but in that case all further validations for the form
will be disregarded(although there is no validation atm)
Reviewed: https:/ /review. openstack. org/4131 github. com/openstack/ horizon/ commit/ 7e717f335861932 7afd7dda9908390 f0d535cf0b
Committed: http://
Submitter: Jenkins
Branch: master
commit 7e717f335861932 7afd7dda9908390 f0d535cf0b
Author: Tihomir Trifonov <email address hidden>
Date: Tue Feb 14 12:29:43 2012 +0200
Sets default values for month/year at Usage Form in overview page
Fixes bug 931227. The problem is with using 'initial' values for DateForm( initial= {'month' : request. GET.get( 'month' , self.today. month,. .) although there is no validation atm)
a bound form. These are mutually exclusive.
Another solution is to use only unbound form,
with setting:
forms.
self.
but in that case all further validations for the form
will be disregarded(
Change-Id: Ie4565b03a1414a 0008abfd793d9ec 4a181e0aa24