def getApartment(id): user_query = ApartmentOwned.objects set_user_for_sharding(user_query, id) apartment = choice(user_query.all()) # print apartment return apartment
def getSubletUser(id): user_query = SubletUser.objects set_user_for_sharding(user_query, id) user = user_query.get(user_pk=id) # print user return user