Created
April 18, 2011 19:29
-
-
Save sc68cal/925996 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/helix/hiv/forms.py b/helix/hiv/forms.py | |
index cbf4a56..5938603 100644 | |
--- a/helix/hiv/forms.py | |
+++ b/helix/hiv/forms.py | |
@@ -4,7 +4,7 @@ from django.http import HttpResponseRedirect | |
from django import forms | |
from helix.hiv.models import * | |
from django.contrib.formtools.wizard import FormWizard | |
-from datetime import datetime | |
+import time | |
class AlcoholForm(Form): | |
current_use = forms.CharField(widget=forms.Select(choices= | |
@@ -203,7 +203,8 @@ class VisitForm(ModelForm): | |
if self.postdata["viral"]: | |
v.viral = self.postdata['viral'] | |
if self.postdata["date"]: | |
- v.date = datetime.strptime(self.postdata['date'],'%m/%d/%Y') | |
+ date = time.strptime(self.postdata['date'],'%m/%d/%Y') | |
+ v.date = time.strftime("%Y-%m-%d",date) | |
else: | |
v.date = None | |
@@ -234,4 +235,4 @@ class VisitForm(ModelForm): | |
e = PatientExposedTo() | |
e.visit = v | |
e.exposure = Exposure.objects.get(pk=exp) | |
- e.save() | |
\ No newline at end of file | |
+ e.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CentOS seriously sucks. Python 2.4? Good lord.