예제 #1
0
def get_result(filters):
    user_id = frappe.db.get_value("User", filters.get("agent"), "user_id")
    res_list = []
    if user_id:
        request_data = json.dumps({
            "user_id": user_id,
            "property_id": filters.get("property_id"),
            "builder": filters.get("agent")
        })
        if not filters.get("property_id"):
            response = get_builder_properties(request_data)
        else:
            response = get_property_of_given_id(request_data)
            response["data"] = [response.get("data")]
        for prop in response.get("data"):
            prop_id = prop.get("property_id")
            prop_visit_count = get_property_visit_count(prop_id)
            property_id = "<a onclick=get_on_click_trigger('{0}')>{0}</a>".format(
                prop_id)
            res_list.append([
                property_id,
                prop.get("property_title"),
                prop.get("property_type"),
                prop.get("property_subtype"),
                prop.get("property_subtype_option"),
                prop.get("location"),
                prop.get("status"), prop_visit_count
            ])
    return res_list
def get_my_properties(doctype, txt, searchfield, start, page_len, filters):
	user_id = frappe.db.get_value("User", filters.get("agent"), "user_id")
	res_list = []
	if user_id:
		request_data = json.dumps({"user_id":user_id,"builder":filters.get("agent")})
		response = get_builder_properties(request_data)
		for prop in response.get("data"):
			res_list.append([prop.get("property_id"),prop.get("property_title")])
	return res_list
예제 #3
0
def get_my_properties(doctype, txt, searchfield, start, page_len, filters):
    user_id = frappe.db.get_value("User", filters.get("agent"), "user_id")
    res_list = []
    if user_id:
        request_data = json.dumps({
            "user_id": user_id,
            "builder": filters.get("agent")
        })
        response = get_builder_properties(request_data)
        for prop in response.get("data"):
            res_list.append(
                [prop.get("property_id"),
                 prop.get("property_title")])
    return res_list
def get_result(filters):
	user_id = frappe.db.get_value("User", filters.get("agent"), "user_id")
	res_list = []
	if user_id:
		request_data = json.dumps({"user_id":user_id, "property_id":filters.get("property_id"),"builder":filters.get("agent")})
		if not filters.get("property_id"):
			response = get_builder_properties(request_data) 
		else: 
			response = get_property_of_given_id(request_data)
			response["data"] = [response.get("data")]
		for prop in response.get("data"):
			prop_id = prop.get("property_id")
			prop_visit_count = get_property_visit_count(prop_id)
			property_id = "<a onclick=get_on_click_trigger('{0}')>{0}</a>".format(prop_id)
			res_list.append([ property_id , prop.get("property_title"), prop.get("property_type"),
							prop.get("property_subtype"), prop.get("property_subtype_option"), prop.get("location"), 
							prop.get("status"), prop.get("posted_datetime"), prop_visit_count])
	return res_list