projects
/
htsworkflow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4f128c8
)
Add stub uuid function to make this module import when running under python2.4
author
Diane Trout
<diane@caltech.edu>
Wed, 17 Jun 2009 19:09:50 +0000
(19:09 +0000)
committer
Diane Trout
<diane@caltech.edu>
Wed, 17 Jun 2009 19:09:50 +0000
(19:09 +0000)
htsworkflow/frontend/inventory/models.py
patch
|
blob
|
history
diff --git
a/htsworkflow/frontend/inventory/models.py
b/htsworkflow/frontend/inventory/models.py
index 8f54fc3abcc87a43739f34c0d1c40a487fd1a69a..5926107d3ee010f209503717e79d1afd288b03be 100644
(file)
--- a/
htsworkflow/frontend/inventory/models.py
+++ b/
htsworkflow/frontend/inventory/models.py
@@
-1,3
+1,5
@@
+import logging
+
from django.db import models
from django.db.models.signals import pre_save
from django.db import models
from django.db.models.signals import pre_save
@@
-5,7
+7,16
@@
from htsworkflow.frontend.samples.models import Library
from htsworkflow.frontend.experiments.models import FlowCell
from htsworkflow.frontend.experiments.models import FlowCell
-import uuid
+try:
+ import uuid
+except ImportError, e:
+ # Some systems are using python 2.4, which doesn't have uuid
+ # this is a stub
+ logging.warning('Real uuid is not available, initializing fake uuid module')
+ class uuid:
+ def uuid1(self):
+ self.hex = None
+ return self
def _assign_uuid(sender, instance, **kwargs):
"""
def _assign_uuid(sender, instance, **kwargs):
"""
@@
-123,4
+134,5
@@
class LongTermStorage(models.Model):
storage_devices = models.ManyToManyField(Item)
def __unicode__(self):
storage_devices = models.ManyToManyField(Item)
def __unicode__(self):
- return u"%s: %s" % (str(self.flowcell), ', '.join([ str(s) for s in self.storage_devices.iterator() ]))
\ No newline at end of file
+ return u"%s: %s" % (str(self.flowcell), ', '.join([ str(s) for s in self.storage_devices.iterator() ]))
+