Example #1
0
    def get_protection_names(self):
        items = ""

        for item in sorted([opt.product_feature for opt in self.protection_features]):
            items = "{0}{1}".format(items, "".join(gut(item)))

        return "".join(items)
Example #2
0
    def get_utility_names(self):
        items = ""

        for item in sorted([opt.product_feature for opt in self.utils_features]):
            items = "{0}{1}".format(items, "".join(gut(item)))

        return items
Example #3
0
    def get_new_name(self):
        serie = self.product_profile

        if len(serie.split(" ")) > 1 \
                or len(serie.split("-")) > 1:
            splitted_product_profile = gut(self.product_profile)

            serie = "-".join(splitted_product_profile)

        increment_part = ".####"

        naming_serie = "-".join((serie, increment_part))
        return make_autoname(naming_serie.upper())
Example #4
0
    def generate_hash(self):
        array = [
            "".join(
                gut(cstr(self.get(key)), 5))
            for key in self.get_fields() if cstr(self.get(key))]

        pre_hash = "".join(array)

        proteccions = "".join((pre_hash,
                               self.get_protection_names()))

        textures = "".join((proteccions,
                            self.get_texture_names()))

        utilities = "".join((textures,
                             self.get_utility_names()))

        new_hash = s_sanitize(
            u"{0}".format(utilities))

        return new_hash.lower()