diff gpp/downloads/models.py @ 210:77b606e0ad5f

Fix #78: improve the download upload_to path.
author Brian Neal <bgneal@gmail.com>
date Fri, 07 May 2010 02:56:49 +0000
parents 272d3a8c98e8
children 8d13baeaa5c1
line wrap: on
line diff
--- a/gpp/downloads/models.py	Wed May 05 03:24:14 2010 +0000
+++ b/gpp/downloads/models.py	Fri May 07 02:56:49 2010 +0000
@@ -33,7 +33,9 @@
     """
     now = datetime.datetime.now()
     parts = ['downloads']
-    parts.extend([str(p) for p in (now.year, now.month, now.day, now.microsecond)])
+    parts.extend([str(p) for p in (now.year, now.month, now.day)])
+    parts.append(hex((now.hour * 3600 + now.minute * 60 + now.second) * 1000 + (
+        now.microsecond / 1000))[2:])
     parts.append(filename)
     return os.path.join(*parts)