projects
/
htsworkflow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2fafeca
)
minor update
author
Rami Rauch
<rrauch@stanford.edu>
Thu, 23 Apr 2009 22:44:49 +0000
(22:44 +0000)
committer
Rami Rauch
<rrauch@stanford.edu>
Thu, 23 Apr 2009 22:44:49 +0000
(22:44 +0000)
htswfrontend/htswfrontend/fctracker/models.py
patch
|
blob
|
history
diff --git
a/htswfrontend/htswfrontend/fctracker/models.py
b/htswfrontend/htswfrontend/fctracker/models.py
index 2b9aaebb7c106432b97a49027be19db452fca90a..2a564d3169336d7191f813c22833de9e867bbe20 100644
(file)
--- a/
htswfrontend/htswfrontend/fctracker/models.py
+++ b/
htswfrontend/htswfrontend/fctracker/models.py
@@
-1,6
+1,7
@@
from django.db import models
from htswfrontend import settings
from htswfrontend.htsw_reports.libinfopar import *
from django.db import models
from htswfrontend import settings
from htswfrontend.htsw_reports.libinfopar import *
+from htswfrontend.files.models import ImageFile
class Primer(models.Model):
primer_name = models.CharField(max_length=100, db_index=True)
class Primer(models.Model):
primer_name = models.CharField(max_length=100, db_index=True)
@@
-28,18
+29,35
@@
class Antibody(models.Model):
source = models.CharField(max_length=500, blank=True, db_index=True)
biology = models.TextField(blank=True)
notes = models.TextField(blank=True)
source = models.CharField(max_length=500, blank=True, db_index=True)
biology = models.TextField(blank=True)
notes = models.TextField(blank=True)
+
+ # added: apr/14/09
+ imagefiles = models.ManyToManyField(ImageFile,related_name='antibody_imagefiles',filter_interface=models.HORIZONTAL,blank=True, null=True)
+
def __str__(self):
return '%s - %s (%s)' % (self.antigene, self.antibodies, self.catalog)
def __str__(self):
return '%s - %s (%s)' % (self.antigene, self.antibodies, self.catalog)
+
+ def image_files(self):
+ images = self.imagefiles.all().order_by('file_title')
+ ar = []
+ for t in images:
+ ar.append('<a href="'+'/files/show/'+t.id.__str__()+'" title="View Image" target="_self">'+t.__str__()+'</a>')
+
+ if len(ar) > 0:
+ return "<div style='max-width:600px'>"+"<br/>".join(ar) +"</div>"
+ else:
+ return ''
+ image_files.allow_tags = True
+
class Meta:
verbose_name_plural = "antibodies"
ordering = ["antigene"]
class Admin:
class Meta:
verbose_name_plural = "antibodies"
ordering = ["antigene"]
class Admin:
- list_display = ('antigene','nickname','antibodies','catalog','source','biology','notes')
+ list_display = ('antigene','nickname','antibodies','catalog','source','
image_files','
biology','notes')
list_filter = ('antibodies','source')
search_fields = ['antigene','nickname','catalog','antibodies','source','biology','notes']
fields = (
(None, {
list_filter = ('antibodies','source')
search_fields = ['antigene','nickname','catalog','antibodies','source','biology','notes']
fields = (
(None, {
- 'fields': (('antigene','nickname','antibodies'),('catalog','source'),('biology'),('notes'))
+ 'fields': (('antigene','nickname','antibodies'),('catalog','source'),('biology'),('
imagefiles'),('
notes'))
}),
)
}),
)
@@
-237,10
+255,10
@@
class Library(models.Model):
DataRun.allow_tags = True
def aligned_m_reads(self):
DataRun.allow_tags = True
def aligned_m_reads(self):
- return getLibReads(self.library_id)
+ return getLibReads(self.library_id
,'ByLib'
)
def aligned_reads(self):
def aligned_reads(self):
- res = getLibReads(self.library_id)
+ res = getLibReads(self.library_id
,'ByLib'
)
# Check data sanlty
if res[2] != 'OK':
# Check data sanlty
if res[2] != 'OK':