[Chandler-dev] loadItemByUUID( ) is being deprecated
Grant Baillie
grant at osafoundation.org
Wed Mar 28 15:50:14 PST 2007
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