def METHOD_NAME(info, id):
    if id is None:
        return None
    try:
        id = UUID(id)
        lookup = Q(id=id)
    except ValueError:
        lookup = Q(number=id) & Q(use_old_id=True)
    database_connection_name = get_database_connection_name(info.context)
    return models.Order.objects.using(database_connection_name).filter(lookup).first()