# Path: stories/settings.py
# DEFAULT_STATUS_CHOICES = (
#     (1, _(u'DRAFT')),
#     (2, _(u'READY FOR EDITING')),
#     (3, _(u'READY TO PUBLISH')),
#     (4, _(u'PUBLISHED')),
#     (5, _(u'REJECTED')),
#     (6, _(u'UN-PUBLISHED')),
# )
# DEFAULT_ORIGIN_CHOICES = (
#     (0, _(u'Admin')),
# )
# DEFAULT_PAGINATION = {
#     'PAGINATE': False,
#     'P_PER_PAGE': 20,
#     'ORPHANS': 4
# }
# DEFAULT_QUICKEDIT_FIELDS = (
#     'headline',
#     'subhead',
#     'kicker',
#     'status',
#     'teaser'
# )
# DEFAULT_SETTINGS = {
#     'AUTHOR_MODEL': 'auth.User',
#     'AUTHOR_MODEL_LIMIT_CHOICES': {'is_staff': True},
#     'DEFAULT_ORIGIN': 0,
#     'DEFAULT_STATUS': 1,
#     'ADMIN_EXTRAS': {
#         'EXTRA_FIELDSETS': (),
#         'RAW_ID_FIELDS': (),
#         'FILTER_HORIZONTAL_FIELDS': ('authors',),
#         'SEARCH_FIELDS': ('headline',),
#         'LIST_PER_PAGE': 25,
#     },
#     'INCLUDE_PRINT': False,
#     'ORDERING': ['-publish_date'],
#     'ORIGIN_CHOICES': DEFAULT_ORIGIN_CHOICES,
#     'PAGINATION': DEFAULT_PAGINATION,
#     'PUBLISHED_STATUS': 4,
#     'QUICKEDIT_FIELDS': DEFAULT_QUICKEDIT_FIELDS,
#     'RELATION_MODELS': [],
#     'STATUS_CHOICES': DEFAULT_STATUS_CHOICES,
#     'THROW_404': True,
#     'USE_REVERSION': False,
#     'WIDGET': None,
#     'WIDGET_ATTRS': None,
#     'WIDGET_FIELDS': ['body', ]
# }
# USER_SETTINGS = getattr(settings, 'STORY_SETTINGS', {})
# COMMENTS_DISABLED = 0
# COMMENTS_ENABLED = 1
# COMMENTS_FROZEN = 2
# COMMENT_STATUSES = (
#     (COMMENTS_DISABLED, _('Comments Disabled')),
#     (COMMENTS_ENABLED, _('Comments Enabled')),
#     (COMMENTS_FROZEN, _('Comments Frozen'))
# )
# RELATIONS = [Q(app_label=al, model=m) for al, m in [x.split('.') for x in DEFAULT_SETTINGS['RELATION_MODELS']]]
#     DEFAULT_SETTINGS['ORDERING'] = DEFAULT_SETTINGS.pop('STORY_ORDERING')


import re
        import warnings
        import reversion
        import categories
from datetime import datetime
from django.contrib.sites.models import Site
from django.contrib.sites.managers import CurrentSiteManager
from django.conf import settings as site_settings
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.db import models
from django.template.loader import select_template
from django.template import Context
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from stories import settings
        from distutils.version import LooseVersion
            from categories.migration import migrate_app
            from django.db.models.signals import post_syncdb
    def published(self):
        queryset = self.get_query_set()
        return queryset.filter(
            publish_date__lte=datetime.now()
        ).filter(
            status__exact=settings.PUBLISHED_STATUS)


class Story(models.Model):
    """
    A newspaper or magazine type story or document that was possibly also
    printed in a periodical.
    """
    headline = models.CharField(
        _("Headline"),
        max_length=100)
    tease_headline = models.CharField(
        _("Tease Headline"),
        max_length=100,
        default="",
        blank=True)
    subhead = models.CharField(
        _("Subheadline"),
        max_length=200,
        blank=True,
        null=True)
    slug = models.SlugField(
        _('Slug'),
        max_length=50)
    authors = models.ManyToManyField(

# Path: stories/settings.py
# DEFAULT_STATUS_CHOICES = (
#     (1, _(u'DRAFT')),
#     (2, _(u'READY FOR EDITING')),
#     (3, _(u'READY TO PUBLISH')),
#     (4, _(u'PUBLISHED')),
#     (5, _(u'REJECTED')),
#     (6, _(u'UN-PUBLISHED')),
# )
# DEFAULT_ORIGIN_CHOICES = (
#     (0, _(u'Admin')),
# )
# DEFAULT_PAGINATION = {
#     'PAGINATE': False,
#     'P_PER_PAGE': 20,
#     'ORPHANS': 4
# }
# DEFAULT_QUICKEDIT_FIELDS = (
#     'headline',
#     'subhead',
#     'kicker',
#     'status',
#     'teaser'
# )
# DEFAULT_SETTINGS = {
#     'AUTHOR_MODEL': 'auth.User',
#     'AUTHOR_MODEL_LIMIT_CHOICES': {'is_staff': True},
#     'DEFAULT_ORIGIN': 0,
#     'DEFAULT_STATUS': 1,
#     'ADMIN_EXTRAS': {
#         'EXTRA_FIELDSETS': (),
#         'RAW_ID_FIELDS': (),
#         'FILTER_HORIZONTAL_FIELDS': ('authors',),
#         'SEARCH_FIELDS': ('headline',),
#         'LIST_PER_PAGE': 25,
#     },
#     'INCLUDE_PRINT': False,
#     'ORDERING': ['-publish_date'],
#     'ORIGIN_CHOICES': DEFAULT_ORIGIN_CHOICES,
#     'PAGINATION': DEFAULT_PAGINATION,
#     'PUBLISHED_STATUS': 4,
#     'QUICKEDIT_FIELDS': DEFAULT_QUICKEDIT_FIELDS,
#     'RELATION_MODELS': [],
#     'STATUS_CHOICES': DEFAULT_STATUS_CHOICES,
#     'THROW_404': True,
#     'USE_REVERSION': False,
#     'WIDGET': None,
#     'WIDGET_ATTRS': None,
#     'WIDGET_FIELDS': ['body', ]
# }
# USER_SETTINGS = getattr(settings, 'STORY_SETTINGS', {})
# COMMENTS_DISABLED = 0
# COMMENTS_ENABLED = 1
# COMMENTS_FROZEN = 2
# COMMENT_STATUSES = (
#     (COMMENTS_DISABLED, _('Comments Disabled')),
#     (COMMENTS_ENABLED, _('Comments Enabled')),
#     (COMMENTS_FROZEN, _('Comments Frozen'))
# )
# RELATIONS = [Q(app_label=al, model=m) for al, m in [x.split('.') for x in DEFAULT_SETTINGS['RELATION_MODELS']]]
#     DEFAULT_SETTINGS['ORDERING'] = DEFAULT_SETTINGS.pop('STORY_ORDERING')


# Path: stories/models.py
import re
        import warnings
        import reversion
        import categories
from datetime import datetime
from django.contrib.sites.models import Site
from django.contrib.sites.managers import CurrentSiteManager
from django.conf import settings as site_settings
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.db import models
from django.template.loader import select_template
from django.template import Context
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from stories import settings
        from distutils.version import LooseVersion
            from categories.migration import migrate_app
            from django.db.models.signals import post_syncdb

    def published(self):
        queryset = self.get_query_set()
        return queryset.filter(
            publish_date__lte=datetime.now()
        ).filter(
            status__exact=settings.PUBLISHED_STATUS)


class Story(models.Model):
    """
    A newspaper or magazine type story or document that was possibly also
    printed in a periodical.
    """
    headline = models.CharField(
        _("Headline"),
        max_length=100)
    tease_headline = models.CharField(
        _("Tease Headline"),
        max_length=100,
        default="",
        blank=True)
    subhead = models.CharField(
        _("Subheadline"),
        max_length=200,
        blank=True,
        null=True)
    slug = models.SlugField(
        _('Slug'),
        max_length=50)
    authors = models.ManyToManyField(

        settings.AUTHOR_MODEL,