示例#1
0
    def __init__(self, conn, year=None, month=None, day=None, eid=None, **kw):
        BaseController.__init__(self, conn)
        self.year = int(year)
        self.month = int(month)
        if eid is None:
            self.eid = self.conn.getEventContext().userId
        else:
            self.eid = eid

        if day:
            self.day = int(day)
            # only for python 2.5
            # date = datetime.datetime.strptime(("%i-%i-%i" % (self.year, self.month, self.day)), "%Y-%m-%d")
            date = datetime.datetime(*(time.strptime((
                "%i-%i-%i" %
                (self.year, self.month, self.day)), "%Y-%m-%d")[0:6]))
            self.displayDate = '%s %s' % (date.strftime("%A, %d"),
                                          date.strftime("%B %Y"))
            self.nameday = date.strftime("%A")
        else:
            # only for python 2.5
            # date = datetime.datetime.strptime(("%i-%i" % (self.year, self.month)), "%Y-%m")
            date = datetime.datetime(
                *(time.strptime(("%i-%i" %
                                 (self.year, self.month)), "%Y-%m")[0:6]))
示例#2
0
 def __init__(self, conn, project=None, dataset=None, image=None, screen=None, plate=None, acquisition=None, well=None, tag=None, tagset=None, file=None, comment=None, annotation=None, index=None, orphaned=None, **kw):
     BaseController.__init__(self, conn)
     if project is not None:
         self.project = self.conn.getObject("Project", project)
         self.assertNotNone(self.project, project, "Project")
         self.assertNotNone(self.project._obj, project, "Project")
     if dataset is not None:
         self.dataset = self.conn.getObject("Dataset", dataset)
         self.assertNotNone(self.dataset, dataset, "Dataset")
         self.assertNotNone(self.dataset._obj, dataset, "Dataset")
     if screen is not None:
         self.screen = self.conn.getObject("Screen", screen)
         self.assertNotNone(self.screen, screen, "Screen")
         self.assertNotNone(self.screen._obj, screen, "Screen")
     if plate is not None:
         self.plate = self.conn.getObject("Plate", plate)
         self.assertNotNone(self.plate, plate, "Plate")
         self.assertNotNone(self.plate._obj, plate, "Plate")
     if acquisition is not None:
         self.acquisition = self.conn.getObject("PlateAcquisition", acquisition)
         self.assertNotNone(self.acquisition, acquisition, "Plate Acquisition")
         self.assertNotNone(self.acquisition._obj, acquisition, "Plate Acquisition")
     if image is not None:
         self.image = self.conn.getObject("Image", image)
         self.assertNotNone(self.image, image, "Image")
         self.assertNotNone(self.image._obj, image, "Image")
     if well is not None:
         self.well = self.conn.getObject("Well", well)
         self.assertNotNone(self.well, well, "Well")
         self.assertNotNone(self.well._obj, well, "Well")
         if index is not None:
             self.well.index = index
     if tag is not None:
         self.tag = self.conn.getObject("Annotation", tag)
         self.assertNotNone(self.tag, tag, "Tag")
         self.assertNotNone(self.tag._obj, tag, "Tag")
     if tagset is not None:
         self.tag = self.conn.getObject("Annotation", tagset)
         self.assertNotNone(self.tag, tagset, "Tag")
         self.assertNotNone(self.tag._obj, tagset, "Tag")
     if comment is not None:
         self.comment = self.conn.getObject("Annotation", comment)
         self.assertNotNone(self.comment, comment, "Comment")
         self.assertNotNone(self.comment._obj, comment, "Comment")
     if file is not None:
         self.file = self.conn.getObject("Annotation", file)
         self.assertNotNone(self.file, file, "File")
         self.assertNotNone(self.file._obj, file, "File")
     if annotation is not None:
         self.annotation = self.conn.getObject("Annotation", annotation)
         self.assertNotNone(self.annotation, annotation, "Annotation")
         self.assertNotNone(self.annotation._obj, annotation, "Annotation")
     if orphaned:
         self.orphaned = True
示例#3
0
 def __init__(self, conn, share_id=None, **kw):
     BaseController.__init__(self, conn)
     
     if share_id is not None: 
         self.share = self.conn.getShare(share_id)
         if self.share is None:
             raise AttributeError("We are sorry, but that share either does not exist, or if it does, you have not been invited to see it. Contact the user you think might own this share for more information.")
         if self.share._obj is None:
             raise AttributeError("We are sorry, but that share either does not exist, or if it does, you have not been invited to see it. Contact the user you think might own this share for more information.")
         if self.share is not None and not self.share.active and not self.share.isOwned():
             raise AttributeError("%s is not active and cannot be visible. Please contact the user you think might own this share for more information." % self.share.getShareType())
示例#4
0
 def __init__(self, conn, share_id=None, **kw):
     BaseController.__init__(self, conn)
     
     if share_id is not None: 
         self.share = self.conn.getShare(share_id)
         if self.share is None:
             raise AttributeError("We are sorry, but that share either does not exist, or if it does, you have not been invited to see it. Contact the user you think might own this share for more information.")
         if self.share._obj is None:
             raise AttributeError("We are sorry, but that share either does not exist, or if it does, you have not been invited to see it. Contact the user you think might own this share for more information.")
         if self.share is not None and not self.share.active and not self.share.isOwned():
             raise AttributeError("%s is not active and cannot be visible. Please contact the user you think might own this share for more information." % self.share.getShareType())
示例#5
0
 def __init__(self, conn, year=None, month=None, day=None, eid=None, **kw):
     BaseController.__init__(self, conn)
     self.year = int(year)
     self.month = int(month)
     if eid is None:
         self.eid = self.conn.getEventContext().userId
     else:
         self.eid = eid
     
     if day:
         self.day = int(day)
         date = datetime.datetime.strptime(("%i-%i-%i" % (self.year, self.month, self.day)), "%Y-%m-%d")
         self.displayDate = '%s %s' % (date.strftime("%A, %d"), date.strftime("%B %Y"))
         self.nameday = date.strftime("%A")
     else:
         date = datetime.datetime.strptime(("%i-%i" % (self.year, self.month)), "%Y-%m")
示例#6
0
 def __init__(self, conn, year=None, month=None, day=None, eid=None, **kw):
     BaseController.__init__(self, conn)
     self.year = int(year)
     self.month = int(month)
     if eid is None:
         self.eid = self.conn.getEventContext().userId
     else:            
         self.eid = eid
     
     if day:
         self.day = int(day)
         # only for python 2.5
         # date = datetime.datetime.strptime(("%i-%i-%i" % (self.year, self.month, self.day)), "%Y-%m-%d")
         date = datetime.datetime(*(time.strptime(("%i-%i-%i" % (self.year, self.month, self.day)), "%Y-%m-%d")[0:6]))
         self.eContext['breadcrumb'] = ['<a href="%s">History</a>' % reverse(viewname="load_history", args=[self.year, self.month, self.day]), '%s %s' % (date.strftime("%A, %d"), date.strftime("%B %Y"))]
         self.nameday = date.strftime("%A")
     else:
         # only for python 2.5
         # date = datetime.datetime.strptime(("%i-%i" % (self.year, self.month)), "%Y-%m")
         date = datetime.datetime(*(time.strptime(("%i-%i" % (self.year, self.month)), "%Y-%m")[0:6]))
         self.eContext['breadcrumb'] = ["History"]
示例#7
0
 def __init__(self, conn, **kw):
     BaseController.__init__(self, conn)
     self.eContext['breadcrumb'] = ['Search']
示例#8
0
 def __init__(self, conn, **kw):
     BaseController.__init__(self, conn)