heh. i already wrote the dictionary part by the time i read this, so I'm inclined to keep it in.  Also because there was a bit of setup getting it right, since it's convenient to carry along the subclass info with OrderItem.id, so we know how to look up the type-specific OrderItem.  So the key of this dict is a namedtuple(class, pk)).  For now the function returns both a dict and a set, generated from the same function (but the dict is unused).  it'll be pretty simple to switch to separate functions if we need it.