[Zapp-cvs-commit] ZApp ZApp_Application.py,1.28,1.29 ZApp_RelationshipItem.py,1.6,1.7 ZApp_Specialis
Brought to you by:
sspickle
|
From: <ssp...@us...> - 2004-01-08 15:26:53
|
Update of /cvsroot/zapp/ZApp
In directory sc8-pr-cvs1:/tmp/cvs-serv21367
Modified Files:
ZApp_Application.py ZApp_RelationshipItem.py
ZApp_Specialist.py
Removed Files:
ZApp_RelationshipManagerMixin.py
Log Message:
adding better relational integrity
Index: ZApp_Application.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Application.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** ZApp_Application.py 16 Dec 2003 17:19:44 -0000 1.28
--- ZApp_Application.py 8 Jan 2004 15:26:50 -0000 1.29
***************
*** 298,312 ****
return v
! def findSpecialistIDs(self):
"""
! brute force search..
"""
! results = []
! specialists = self.ZopeFind(self, obj_metatypes=self.specialistMetaTypes, search_sub=1)
! put = results.append
! for p, spec in specialists:
! put(spec.id)
return results
--- 298,325 ----
return v
! def findSpecialistIDs(self, specialistIDs=None, returnObjects=0):
"""
! brute force search.. return objects rather than IDs if specified.
"""
! if specialistIDs is None:
! specialists = self.ZopeFind(self, obj_metatypes=self.specialistMetaTypes, search_sub=1)
! else:
! specialists = self.ZopeFind(self, obj_metatypes=self.specialistMetaTypes, obj_ids=specialistIDs, search_sub=1)
! sortSpecList = [(spec.zapp_spec_order, p, spec) for p, spec in specialists]
! sortSpecList.sort()
! specialists = [(p, spec) for tag, p, spec in sortSpecList]
!
!
! results = []
!
! if returnObjects:
! results = specialists
!
! else:
! put = results.append
! for p, spec in specialists:
! put(spec.getId())
return results
***************
*** 482,486 ****
safeLevers=safeLevers)
! def runLever(self, leverName='createSQLLever', dbName='test_db', specialistIDs='', specialistMetaTypes=None, catalogName='', safeLevers=1):
"""
Run a Lever
--- 495,499 ----
safeLevers=safeLevers)
! def runLever(self, leverName='createSQLLever', dbName='test_db', specialistIDs=None, specialistMetaTypes=None, catalogName='', safeLevers=1):
"""
Run a Lever
***************
*** 491,499 ****
resultList.append("looking in " + self.getId() + " for " + `specialistMetaTypes`)
! if specialistIDs:
! specialists = self.ZopeFind(self, obj_metatypes=specialistMetaTypes, obj_ids=specialistIDs, search_sub=1)
! else:
! specialists = self.ZopeFind(self, obj_metatypes=specialistMetaTypes, search_sub=1)
!
if specialists:
for p, spec in specialists:
--- 504,508 ----
resultList.append("looking in " + self.getId() + " for " + `specialistMetaTypes`)
! specialists = self.findSpecialistIDs(specialistIDs, returnObjects=1)
if specialists:
for p, spec in specialists:
Index: ZApp_RelationshipItem.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_RelationshipItem.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ZApp_RelationshipItem.py 28 Oct 2003 20:27:03 -0000 1.6
--- ZApp_RelationshipItem.py 8 Jan 2004 15:26:50 -0000 1.7
***************
*** 26,29 ****
--- 26,31 ----
_indexed_attrs = ('objectID',)
+ ZApp_referenceLookup = "relationshipID:Relationships:relationshipID"
+
def getObject(self):
"""
Index: ZApp_Specialist.py
===================================================================
RCS file: /cvsroot/zapp/ZApp/ZApp_Specialist.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** ZApp_Specialist.py 8 Jan 2004 11:20:25 -0000 1.33
--- ZApp_Specialist.py 8 Jan 2004 15:26:50 -0000 1.34
***************
*** 101,104 ****
--- 101,112 ----
meta_type = 'Z App Specialist'
+ def zapp_spec_order(self):
+ return self.getId()
+
+ zapp_spec_order = ComputedAttribute( zapp_spec_order )
+
+ _properties=({'id':'title', 'type': 'string', 'mode':'w'},
+ {'id':'zapp_spec_order','type':'string','mode':'w'},)
+
LeversSetsGroup = PlugInGroup('LeversSetsGroup', ['ZApp Lever Method Sets'], attr='leverList', title='Lever Sets')
***************
*** 443,447 ****
"""
missing = []
!
refLookup = getattr(self, 'ZApp_referenceLookup', missing)
--- 451,455 ----
"""
missing = []
!
refLookup = getattr(self, 'ZApp_referenceLookup', missing)
***************
*** 458,463 ****
result = {}
for item in refLookup:
! if type(refLookup) == type(''):
! rList = refLookup.split(':')
if len(rList) >= 3:
result[ rList[0] ] = [ rList[1], rList[2] ]
--- 466,471 ----
result = {}
for item in refLookup:
! if type(item) == type(''):
! rList = item.strip().split(':')
if len(rList) >= 3:
result[ rList[0] ] = [ rList[1], rList[2] ]
--- ZApp_RelationshipManagerMixin.py DELETED ---
|