[Chandler-dev] loadItemByUUID( ) is being deprecated

Grant Baillie grant at osafoundation.org
Wed Mar 28 15:58:59 PST 2007


On 28 Mar, 2007, at 16:52, Morgen Sagen wrote:

> Just testing you.  :-)
>
> Thanks for pointing out the error, Grant.

Actually, after I sent that, I realized it's actually  
withItemForUUID, not withItemByUUID. Hopefully, there will be no more  
corrections to this one word :).

--Grant

> On Mar 28, 2007, at 4:50 PM, Grant Baillie wrote:
>
>> A minor correction: The @self.loadItemByUUID(...) line below  
>> should be
>>
>> 	@self.withItemByUUID(record.uuid, pim.ContentItem,  
>> displayName=record.title, createdOn=createdOn)
>>
>> --Grant
>>
>> On 28 Mar, 2007, at 13:20, Morgen Sagen wrote:
>>
>>> ...
>>> 2) decorator: if your importer actually needs access to the item  
>>> being loaded/created, you'll need to write a nested method which  
>>> accepts the item as its argument, and decorate that method with  
>>> self.withItemForUUID( )
>>>
>>>    For example, in the ItemRecord.importer, what was:
>>>
>>> 	item = self.loadItemByUUID(record.uuid, pim.ContentItem,  
>>> displayName=record.title, createdOn=createdOn)
>>> 	if record.triage != "" and record.triage not in emptyValues:
>>> 		[... snip ...]
>>> 		item.doAutoTriageOnDateChange = (auto == "1")
>>>
>>>    becomes:
>>>
>>> 	@self.loadItemByUUID(record.uuid, pim.ContentItem,  
>>> displayName=record.title, createdOn=createdOn)
>>> 	def do(item):
>>> 		if record.triage != "" and record.triage not in emptyValues:
>>> 			[... snip ...]
>>> 			item.doAutoTriageOnDateChange = (auto == "1")
>>> ...


More information about the chandler-dev mailing list