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)})
def get_all_by_template(template): """ Get all data belonging to the specified template. Args: template: Returns: """ return Data.objects(template=template)
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)