Revision c3f6cdf1 snf-astakos-app/astakos/im/forms.py
b/snf-astakos-app/astakos/im/forms.py | ||
---|---|---|
102 | 102 |
self.fields.keyOrder.extend(['recaptcha_challenge_field', |
103 | 103 |
'recaptcha_response_field', ]) |
104 | 104 |
if get_latest_terms(): |
105 |
self.fields.keyOrder.append('has_signed_terms')
|
|
105 |
self.fields.keyOrder.append('has_signed_terms')
|
|
106 | 106 |
|
107 | 107 |
if 'has_signed_terms' in self.fields: |
108 | 108 |
# Overriding field label since we need to apply a link |
... | ... | |
603 | 603 |
) |
604 | 604 |
start_date = forms.DateTimeField() |
605 | 605 |
end_date = forms.DateTimeField() |
606 |
action = forms.ChoiceField(choices=(), required=False) |
|
607 |
|
|
606 |
details = forms.BooleanField(required=False, label="detailed listing?") |
|
607 |
operation = forms.ChoiceField(choices = ( |
|
608 |
('', '[Choose Charging Method]'), |
|
609 |
('charge_usage', 'Charge Usage'), |
|
610 |
('charge_traffic', 'Charge Traffic') |
|
611 |
)) |
|
608 | 612 |
def clean(self): |
609 | 613 |
super(TimelineForm, self).clean() |
610 | 614 |
d = self.cleaned_data |
611 | 615 |
if 'resource' in d: |
612 | 616 |
d['resource'] = str(d['resource']) |
613 | 617 |
if 'start_date' in d: |
614 |
d['start_date'] = d['start_date'].strftime("%Y-%m-%dT%H:%M:%S.%f") |
|
618 |
d['start_date'] = d['start_date'].strftime("%Y-%m-%dT%H:%M:%S.%f")[:24]
|
|
615 | 619 |
if 'end_date' in d: |
616 |
d['end_date'] = d['end_date'].strftime("%%Y-%m-%dT%H:%M:%S.%f") |
|
617 |
return d |
|
620 |
d['end_date'] = d['end_date'].strftime("%Y-%m-%dT%H:%M:%S.%f")[:24] |
|
621 |
return d |
|
622 |
|
Also available in: Unified diff