Allow a custom ID field to be passed to WebAPIResource.get_object.
Review Request #4819 — Created Oct. 21, 2013 and submitted — Latest diff uploaded
Allow a custom ID field to be passed to WebAPIResource.get_object.
There's a case in Review Board where a resource is overriding
WebAPIResource.get_object in order to change which ID field a particular
ID is matched against. That makes it easy to get out of sync regarding
logic and optimizations.get_object now takes an optional id_field argument. If specified, it
will use that field for the lookup. Subclasses can then make use of
the real get_object and just pass in a different value for id_field.
Tested against an accompanying change in Review Board. All unit tests passed.