diff options
author | Filipp Lepalaan <filipp@mac.com> | 2015-08-18 23:37:05 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2015-08-18 23:37:05 +0300 |
commit | 09731610e0c037a3c6a6068d71f4dca887389f26 (patch) | |
tree | a62710dc46138189d4c7f8e7a7d8363f9fdb8baf /servo/stats | |
parent | 12a991f475e38cb7e2a32ef3afb4b733aeae4771 (diff) | |
download | Servo-09731610e0c037a3c6a6068d71f4dca887389f26.tar.gz Servo-09731610e0c037a3c6a6068d71f4dca887389f26.tar.bz2 Servo-09731610e0c037a3c6a6068d71f4dca887389f26.zip |
Fixed session problems in stats
Diffstat (limited to 'servo/stats')
-rw-r--r-- | servo/stats/forms.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/servo/stats/forms.py b/servo/stats/forms.py index d1ec2aa..918695f 100644 --- a/servo/stats/forms.py +++ b/servo/stats/forms.py @@ -55,6 +55,19 @@ class BasicStatsForm(forms.Form): widget=DatepickerInput(attrs={'class': "input-small"}) ) + def serialize(self): + import datetime + from django.db.models import Model + cd = self.cleaned_data + + for k, v in cd.iteritems(): + if isinstance(v, datetime.datetime): + cd[k] = str(v) + if isinstance(v, Model): + cd[k] = v.pk + + return cd + class OrderStatsForm(BasicStatsForm): location = forms.ModelChoiceField( |