# Path: util/html_clean.py
# def clean_for_description(html):
#     """
#     Removes dangerous tags.
#     """
#     allowed_attrs = bleach.ALLOWED_ATTRIBUTES
#     allowed_attrs['img'] = ['src']
#     return bleach.clean(html, tags=DESCR_ALLOWED_TAGS, attributes=allowed_attrs, strip=True)


from django.db import models
from markdown import markdown
from util.html_clean import clean_for_description

class News(models.Model):
    headline = models.CharField(max_length=30)
    entry = models.TextField(blank=True, default="")
    author = models.CharField(max_length=301)

# Path: util/html_clean.py
# def clean_for_description(html):
#     """
#     Removes dangerous tags.
#     """
#     allowed_attrs = bleach.ALLOWED_ATTRIBUTES
#     allowed_attrs['img'] = ['src']
#     return bleach.clean(html, tags=DESCR_ALLOWED_TAGS, attributes=allowed_attrs, strip=True)


# Path: course/models/news.py
from django.db import models
from markdown import markdown
from util.html_clean import clean_for_description


class News(models.Model):
    headline = models.CharField(max_length=30)
    entry = models.TextField(blank=True, default="")
    author = models.CharField(max_length=301)

    modified = models.DateField(auto_now=True)