示例#1
0
    def getServiceName(self, record):
        serviceId = forceRef(record.value('service_id'))
        name = CCol.resolveValueByCaches(serviceId,
                                         [(self.serviceCache, 'name')])
        if name != CCol.invalid:
            return name, self.ServiceSource

        actionId = forceRef(record.value('action_id'))
        name = CCol.resolveValueByCaches(actionId,
                                         [(self.actionCache, 'actionType_id'),
                                          (self.actionTypeCache, 'name')])
        if name != CCol.invalid:
            return name, self.ActionSource

        visitId = forceRef(record.value('visit_id'))
        name = CCol.resolveValueByCaches(visitId,
                                         [(self.visitCache, 'service_id'),
                                          (self.serviceCache, 'name')])
        if name != CCol.invalid:
            return name, self.VisitSource

        eventId = forceRef(record.value('event_id'))
        name = CCol.resolveValueByCaches(eventId,
                                         [(self.eventCache, 'eventType_id'),
                                          (self.eventTypeCache, 'name')])
        return name, self.EventSource
示例#2
0
 def updateServiceName(self):
     serviceId = self.cmbService.value()
     if serviceId:
         sourceName = u'Услуга'
         name = forceString(
             CCol.resolveValueByCaches(serviceId,
                                       [(self.serviceCache, 'name')]))
     else:
         sourceName = u''
         name = u''
     self.lblServiceNameSource.setText(sourceName)
     self.lblServiceName.setText(name)