Skip to content

Instantly share code, notes, and snippets.

@ashaegupta
Created October 19, 2011 02:08
Show Gist options
  • Save ashaegupta/1297314 to your computer and use it in GitHub Desktop.
Save ashaegupta/1297314 to your computer and use it in GitHub Desktop.
Way to improve this
@classmethod
def get_matches_for_status_matched(klass, ride_doc):
ride=[]
# first ensure status is matched
if ride_doc.get(Ride.A_STATUS)==2:
# get the match ride and user info
match_ride_id = ride_doc.get(Ride.A_MATCH_ID)
if match_ride_id:
match_ride = klass.get_ride(match_ride_id)
if match_ride:
user_id = match_ride_id.get(klass.A_USER_ID)
if user_id:
user_doc = UserHelper.get_users_by_id(user_id)
# link the
if user_doc:
match_ride["user"]=user_doc
ride = match_ride
return ride
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment