def save(self, *args, **kwargs): """ """ super(Element, self).save(*args, **kwargs) if not self.name_id: name_id = self.name.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.name_id = (djslugify(name_id)).replace('-', '_') self.save()
def save(self, *args, **kwargs): """ """ super(Device, self).save(*args, **kwargs) if not self.slug: name = self.name.replace(u'\u0131', 'i') #turkce karakter 'ı' icin self.slug = djslugify(name + "-" + str(self.id)) self.save()
def save(self, *args, **kwargs): """ Slug save """ super(Site, self).save(*args, **kwargs) if not self.slug: slug = self.web_site_address slug = slug.replace(u'http://www', '') slug = slug.replace(u'https://www', '') slug = slug.replace(u'http://', '') slug = slug.replace(u'https://', '') slug = slug.replace(u'www', '') self.slug = djslugify(slug + "-" + str(self.id)) self.save() try: ping_google() except Exception: pass
def save(self, *args, **kwargs): """ """ if not self.channel_name_id: name = self.channel_name.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.channel_name_id = (djslugify(name)).replace('-', '_') if not self.element_id_1: name = self.element_1.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.element_id_1 = (djslugify(name)).replace('-', '_') if not self.element_id_2: name = self.element_2.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.element_id_2 = (djslugify(name)).replace('-', '_') if not self.element_id_3: name = self.element_3.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.element_id_3 = (djslugify(name)).replace('-', '_') if not self.element_id_4: name = self.element_4.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.element_id_4 = (djslugify(name)).replace('-', '_') if not self.element_id_5: name = self.element_5.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.element_id_5 = (djslugify(name)).replace('-', '_') if not self.element_id_6: name = self.element_6.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.element_id_6 = (djslugify(name)).replace('-', '_') if not self.element_id_7: name = self.element_7.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.element_id_7 = (djslugify(name)).replace('-', '_') if not self.element_id_8: name = self.element_8.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.element_id_8 = (djslugify(name)).replace('-', '_') if not self.element_id_9: name = self.element_9.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.element_id_9 = (djslugify(name)).replace('-', '_') if not self.element_id_10: name = self.element_10.replace(u'\u0131', 'i') # turkce karakter 'ı' icin self.element_id_10 = (djslugify(name)).replace('-', '_') super(Channel, self).save(*args, **kwargs)
def slugify(title): return djslugify(unidecode(title))
def slugify(value: str) -> str: return djslugify(unidecode(value))