From 131422d0310a289ec823d92ab19aa797a4c63416 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 15 Dec 2009 23:42:22 +0000 Subject: [PATCH] Define the unicode() function for HTSUser to also report the users full name. ticket:149 Make adding a user to an affiliation optional ticket:150 --- htsworkflow/frontend/samples/models.py | 5 ++++- htsworkflow/frontend/samples/views.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htsworkflow/frontend/samples/models.py b/htsworkflow/frontend/samples/models.py index a5b3327..cda52a3 100644 --- a/htsworkflow/frontend/samples/models.py +++ b/htsworkflow/frontend/samples/models.py @@ -104,7 +104,7 @@ class Affiliation(models.Model): name = models.CharField(max_length=256, db_index=True, verbose_name='Name') contact = models.CharField(max_length=256, null=True, blank=True,verbose_name='Lab Name') email = models.EmailField(null=True,blank=True) - users = models.ManyToManyField('HTSUser', null=True) + users = models.ManyToManyField('HTSUser', null=True, blank=True) users.admin_order_field = "username" def __unicode__(self): @@ -275,6 +275,9 @@ class HTSUser(User): def admin_url(self): return '/admin/%s/%s/%d' % (self._meta.app_label, self._meta.module_name, self.id) + + def __unicode__(self): + return unicode(self.username) + u" (" + unicode(self.get_full_name()) + u")" def HTSUserInsertID(sender, instance, **kwargs): """ diff --git a/htsworkflow/frontend/samples/views.py b/htsworkflow/frontend/samples/views.py index 20c3d98..a14b22c 100644 --- a/htsworkflow/frontend/samples/views.py +++ b/htsworkflow/frontend/samples/views.py @@ -382,6 +382,7 @@ def _make_eland_results(flowcell_id, lane, interesting_flowcells): result_path = cur_fc[cycle]['eland_results'].get(lane, None) result_link = make_result_link(fc_id, cycle, lane, result_path) results.append({'flowcell_id': fc_id, + 'run_date': flowcell.run_date, 'cycle': cycle, 'lane': lane, 'summary_url': make_summary_url(flowcell_id, cycle), -- 2.30.2