Textdoc
Zipdoc
Writeurl
Loading…
def clean_content(self): content = self.cleaned_data.get('content') arr = re.findall(r"#(w+)", content) for hsh in arr: if len(hsh) < 80: full_hash = '#' + hsh if Category.objects.filter(name__iexact=hsh): print('Exists') content = content.replace(full_hash, f'
#{hsh}
') else: content = content.replace(full_hash, f'
#{hsh}
')