-
-
You can access the data from a resource using both attributes,
or key lookup:review_request.draft
vs:
review_request['draft']
So, if you prefer this conditional could be written like so:
if 'draft' in review_request:
Just a heads up. Go with whatever you prefer.
-
access to a Resource's 'fields' attribute is something we shouldn't
really be doing. The fact that it's not "private" is just a mistake
I made when restructuring the whole transport stuff. We should really
rename it "_fields" and not touch it.You will have the same effect if you change this to:
fields = review_request
Speed up rbt post -u.
Review Request #5099 — Created Dec. 11, 2013 and submitted
Speed up rbt post -u.
rbt post -u, in an effort to match draft summaries, was fetching every
opened draft for a user individually and pulling info from them. This
was slow, particularly with lots of pending review requests.Now it uses the field expansion support in the API to fetch drafts in
one go, reducing the number of calls significantly.
Ran with
--debug
and saw that it wasn't fetching drafts anymore.Tested with and without pending drafts. It matched correctly.
Description | From | Last Updated |
---|---|---|
access to a Resource's 'fields' attribute is something we shouldn't really be doing. The fact that it's not "private" is … |
SM smacleod | |
Will this work properly? Remember, as of now ".draft" isn't a real dictionary. I don't believe I've defined a __nonzero__ … |
SM smacleod |