Add a link to the public library summary page off from the libray admin list
authorDiane Trout <diane@caltech.edu>
Sat, 28 Feb 2009 01:05:28 +0000 (01:05 +0000)
committerDiane Trout <diane@caltech.edu>
Sat, 28 Feb 2009 01:05:28 +0000 (01:05 +0000)
htsworkflow/frontend/samples/admin.py
htsworkflow/frontend/samples/models.py

index 00dea2a90e9d6cec1370318d35b8f95103055298..a8494f6e4928b41320979d0a96f9f1a8b5b9d710 100644 (file)
@@ -30,6 +30,7 @@ class LibraryOptions(admin.ModelAdmin):
         #'aligned_reads',
         #'DataRun',
         'library_name',
+        'public',
         #'experiment_type',
         #'organism',
         #'antibody_name',
@@ -40,7 +41,7 @@ class LibraryOptions(admin.ModelAdmin):
         #'made_by',
         'undiluted_concentration',
         'creation_date',
-       'stopping_point',
+        'stopping_point',
         #'condition',
 
     )
index 8a5c31a85efc83ee500b87b6e7413a14e4794ba0..c43f11139e4fc8167d749e205039a81cc1ced3fe 100644 (file)
@@ -1,3 +1,4 @@
+import urlparse
 from django.db import models
 from django.contrib.auth.models import User
 from htsworkflow.frontend import settings
@@ -229,3 +230,8 @@ class Library(models.Model):
     return tstr
   aligned_reads.allow_tags = True
 
+  def public(self):
+    SITE_ROOT = '/'
+    summary_url = urlparse.urljoin(SITE_ROOT, 'library/%s' % (self.library_id))
+    return '<a href="%s">S</a>' % (summary_url,)
+  public.allow_tags = True