You are leaking internal IDs here.

Don't `derived_from` have to be mapped to a dict or something?