Beispiel #1
0
    def _get_properties(self, properties):

        property_map = {}
        for property_and_values in properties.split():
            key, values = property_and_values.split(self.TAG_PROPERTY_SEPARATOR)
            property_map[key] = utils.remove_braces(values).replace(" ", "").split(self.INTER_PROPERTY_SEPARATOR)
        
        return property_map
Beispiel #2
0
    def get_final_query(self, action, properties):
        
        property_map = {}

        for property_and_values in properties.split():
            key, values =  property_and_values.split(":")
            property_map[key] = utils.remove_braces(values).split(",")

        result = self.RETURN + utils.compound_property_starting_braces(properties)
        
        for key, value in property_map.iteritems():
            for index, property_element in enumerate(value):
                result += ''.join([utils.not_first_element_comma(index), self.PYQUERY_HEAD, 
                                  Property().get(key),
                                  utils.trim_single_quotes(property_element),
                                  self.CLOSING_PARENTHESIS,
                                  Action().get(action)])
                
        return "%s%s" % (result, utils.compound_property_ending_braces(properties))