예제 #1
0
 def getClientInfo(self, clientid):
     clause = Eq('clientid', clientid)
     client = self.db.select_row(fields=['client'], table='clients', clause=clause).client
     cfields = ['name', 'addressid', 'email', 'description']
     lfields = ['addressid', 'isp', 'connection', 'ip', 'static', 'serviced']
     lquery, lclause = self._preparequeries(clientid, 'locationid', lfields, 'locations')
     cquery, cclause = self._preparequeries(clientid, 'contactid', cfields, 'contacts')
     aclause = ' or '.join(['addressid IN (%s)' % q for q in [cquery, lquery]])
     addresses = self.getAddresses(aclause)
     adata = RefData(dict(address='addressid'))
     adata.set_refdata('address', addresses)
     contacts, ignore = self.getContacts(clientid, False)
     contacts = [RefRecord(c, adata) for c in contacts]
     locations, ignore = self.getLocations(clientid, False)
     locations = [RefRecord(l, adata) for l in locations]
     return dict(client=client, contacts=contacts,
                 locations=locations, addresses=adata)
예제 #2
0
 def __init__(self):
     RefData.__init__(self, dict(address='addressid'))