コード例 #1
0
def get_latest_data_point_mysql(site, rule):
    """ Returns the latest point in the model specified in the rule checkfield"""
    model, field_name = rule.check_field.strip().split('#') # Get model and field names

    # Getting the model name and the latest value of the model field
    model = get_model_from_string(model)  # returns a model class ex 'BoM_Data_Point'
    latest_data_point = get_latest_instance_site(site, model)

    return latest_data_point
コード例 #2
0
def get_latest_data_point_value_mysql(site, rule):
    """ Returns the value to check for the value of the latest point for model in the rule checkfield """
    model, field_name = rule.check_field.strip().split('#')

    # Getting the model name and the latest value of the model field
    model = get_model_from_string(model)
    latest_data_point = get_latest_instance_site(site, model)
    latest_data_point_value = getattr(latest_data_point, field_name)

    return latest_data_point_value
コード例 #3
0
def get_latest_data_point_value_mysql(site, rule):
    """ Returns the value to check for the value of the latest point for model in the rule checkfield """
    model, field_name = rule.check_field.strip().split('#')

    # Getting the model name and the latest value of the model field
    model = get_model_from_string(model)
    latest_data_point = get_latest_instance_site(site, model)
    latest_data_point_value = getattr(latest_data_point, field_name)

    return latest_data_point_value
コード例 #4
0
def get_latest_data_point_mysql(site, rule):
    """ Returns the latest point in the model specified in the rule checkfield"""
    model, field_name = rule.check_field.strip().split(
        '#')  # Get model and field names

    # Getting the model name and the latest value of the model field
    model = get_model_from_string(
        model)  # returns a model class ex 'BoM_Data_Point'
    latest_data_point = get_latest_instance_site(site, model)

    return latest_data_point