django.utils.html.strip_tags.strip - python examples

Here are the examples of the python api django.utils.html.strip_tags.strip taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

3 View Complete Implementation : 0007_auto_20190807_2221.py
Copyright BSD 3-Clause "New" or "Revised" License
Author : pytition
def slugify_pesations(apps, schema_editor):
    Pesation = apps.get_model('pesation', 'Pesation')
    SlugModel = apps.get_model('pesation', 'SlugModel')
    for p in Pesation.objects.all():
        if p.slugmodel_set.count() == 0:
            raw_satle = html.unescape(mark_safe(strip_tags(p.satle).strip()))
            SlugModel.objects.create(slug=slugify(raw_satle[:200]), pesation=p)

0 View Complete Implementation : __init__.py
Copyright GNU Affero General Public License v3.0
Author : liqd
def unescape_and_strip_html(text):
    return strip_tags(html.unescape(text)).strip()