예제 #1
0
def is_local_id_already_used(local_id):
    """Check if the local id given already exist in db

    Args:
        local_id:

    Returns:

    """
    return Data.objects(__raw__={"dict_content.Resource.@localid": str(local_id)})
예제 #2
0
def get_all_by_template(template):
    """ Get all data belonging to the specified template.

    Args:
        template:

    Returns:

    """
    return Data.objects(template=template)
예제 #3
0
def get_all_by_template(template, order_by_field=DATA_SORTING_FIELDS):
    """Get all data belonging to the specified template.

    Args:
        template:
        order_by_field:

    Returns:

    """
    return Data.objects(template=template).order_by(order_by_field)