[Pulp-list] Importer Sync APIs

Jay Dobies jason.dobies at redhat.com
Tue Nov 22 19:00:28 UTC 2011


On 11/22/2011 12:23 PM, Jason L Connor wrote:
> On Tue, 2011-11-22 at 10:18 -0500, Jay Dobies wrote:
>> I'm unsure of how people would best want the return type. I can see
>> an
>> argument for wanting to organize by unit keys too.
>>
>> So to that end, I'm returning a custom object (currently named
>> UnitBag,
>> but I may find something better) that offers a bunch of
>> transformations
>> (queries is probably a better term) on the set of units. So "give me
>> them by unit key" or "give me just the unit keys" or "give me them
>> mapped by ID". Stuff like that.
>
> I guess I don't really see the point of this. I'd like to just see an
> api that returns a list of ContentUnitData instances.
>
> If you decide that plugin writer want more granulatiry on their queries,
> the queries you're proposing could simply be methods on the conduit
> instead on some new UnitBag object.

Either way, doesn't really matter to me. I wanted to avoid plugins from 
having to do a lot of common transformations on the returned data, but 
if I can get it down to a single list then pretty much any view on the 
data is just a list comprehension away.

The more pressing issue is trying to reconstruct the unit objects from 
the database; I'd be happy to return a list if I can get to that point :)


-- 
Jay Dobies
Freenode: jdob @ #pulp
http://pulpproject.org | http://blog.pulpproject.org




More information about the Pulp-list mailing list