Beispiel #1
0
	def domains(self, entity_type):
		'''returns list of attribute domains for this entity_type'''
		entity_type = entity_type or 'case' # default if no param
		query = '''SELECT STRAIGHT_JOIN D.dom_name
		FROM ety_entity_type T
		JOIN exd_ety_x_domain E ON E.exd_ety_id = T.ety_id
		JOIN dom_domain D ON D.dom_id = E.exd_dom_id
		WHERE ety_name = '{0}';'''.format(entity_type)
		return sqlFetchAll(query)
Beispiel #2
0
prefsToFetch = ['autoLogoffInterval', 'listColor']
# get a few (two) values stored in the "preference" domain
partialPreferenceVals = user333Atts.getAtts('preference', prefsToFetch)

print('Entity id={0} and type="{1}"'.format(user333Atts['id'], user333Atts['type']))
print('')
print('all Vals from Attribute domain')
print(allAttributeVals)
print('')
print('partial Vals from Preference domain')
print(partialPreferenceVals)

print('')
print('Everything just stored (assuming you truncated first) is:')
results = sqlFetchAll('SELECT * FROM stored_data where ent_id = 17;')
print(results)

userSearchObj = EntitySearch('user', company_id=3)

usersWithTheseAttVals = userSearchObj.fetch('attribute', 'name:dewey gaedcke,age:39,dob:11081963,sex:m,')
print('usersWithTheseAttVals')
print(usersWithTheseAttVals)

# to see all the data just stored (assuming you truncated first), run:
# SELECT STRAIGHT_JOIN
# 	D.dom_name AS domain, A.att_name AS attribute_name
# 	, COALESCE(L.lva_value, V.val_value) AS att_value
# 	, COALESCE(Y.dty_name,'???') AS data_type
# 	, V.val_mod_dttm AS mod_dttm, V.val_id
# 	, V.val_ent_id AS ent_id