Beispiel #1
0
def get_element_key_by_ref(element_ref):
	query = Elements.query(Elements.element_ref == element_ref)
	elem = query.get()
	if elem is None:
		return None
	else:
		return elem.key
Beispiel #2
0
def remove_element_by_ref(element_ref):
	query = Elements.query(Elements.element_ref == element_ref)
	elem = query.get()

	if elem is None:
		return False
	else:
		elem.key.delete()
		return True
Beispiel #3
0
def rename_element(old_ref, new_ref):
	query = Elements.query(Elements.element_ref == old_ref)
	elem = query.get()

	elem.element_ref = new_ref
	return elem.put()
Beispiel #4
0
def add_element(ref):
	elem = Elements(element_ref = ref)
	return elem.put()