[Chandler-dev] loadItemByUUID( ) is being deprecated
Morgen Sagen
morgen at osafoundation.org
Wed Mar 28 15:52:55 PST 2007
Just testing you. :-)
Thanks for pointing out the error, Grant.
~morgen
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")
>> ...
>
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> Open Source Applications Foundation "chandler-dev" mailing list
> http://lists.osafoundation.org/mailman/listinfo/chandler-dev
More information about the chandler-dev
mailing list