Database bulk loaders helpers do not support nested FK attributes

Bug #1311690 reported by Celso Providelo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

The existing bulk loader helpers from lp.services.database.bulk (load_related() and load_referencing()) only support direct FK attributes, i.e. load_related(Foo, rows, ['fooID']).

But sometimes it is necessary to load deeper related objects, i.e. load_related(Foo, rows, ['bar.baz.fooID'])

That can be achieved by replacing "map(partial(getattr, obj), fk)" by "map(attrgetter(fk), obj)" or something along this line.

Tags: tech-debt
Celso Providelo (cprov)
Changed in launchpad:
status: New → Triaged
importance: Undecided → Low
tags: added: tech-debt
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.