Google's style guide doesn't allow using backslashes for line continuation.  I agree with that rule because it could cause unintended consequences if there's trailing whitespace, which is invisible to most folks.  The alternatives are to do extra work in earlier lines (eg, making the ndb.key earlier) or to use an extra pair of parentheses (eg, a parenthesis before models will mean that Python knows the statement won't end until it gets a closing parenthesis).  

Another option would be to put this in a helper function.  That might be a good idea since some of the logic seems to be getting pretty complicated.