# Path: pinax/blog/conf.py
# def is_installed(package):
#     def configure_markup_choices(self, value):
#     def configure_hookset(self, value):
# DEFAULT_MARKUP_CHOICE_MAP = {
#     "markdown": {"label": "Markdown", "parser": "pinax.blog.parsers.markdown_parser.parse"}
# }
#     ALL_SECTION_NAME = "all"
#     SECTIONS = []
#     UNPUBLISHED_STATES = [
#         "Draft"
#     ]
#     FEED_TITLE = "Blog"
#     SECTION_FEED_TITLE = "Blog (%s)"
#     MARKUP_CHOICE_MAP = DEFAULT_MARKUP_CHOICE_MAP
#     MARKUP_CHOICES = DEFAULT_MARKUP_CHOICE_MAP
#     SCOPING_MODEL = None
#     SCOPING_URL_VAR = None
#     SLUG_UNIQUE = False
#     PAGINATE_BY = 10
#     HOOKSET = "pinax.blog.hooks.PinaxBlogDefaultHookSet"
#     ADMIN_JS = ("js/admin_post_form.js",)
# class PinaxBlogAppConf(AppConf):
#     class Meta:


from django.db import models
from django.utils import timezone
from .conf import settings


PUBLISHED_STATE = len(settings.PINAX_BLOG_UNPUBLISHED_STATES) + 1


class PostManager(models.Manager):

    def published(self):
        return self.filter(published__lte=timezone.now(), state=PUBLISHED_STATE)

    def current(self):

# Path: pinax/blog/conf.py
# def is_installed(package):
#     def configure_markup_choices(self, value):
#     def configure_hookset(self, value):
# DEFAULT_MARKUP_CHOICE_MAP = {
#     "markdown": {"label": "Markdown", "parser": "pinax.blog.parsers.markdown_parser.parse"}
# }
#     ALL_SECTION_NAME = "all"
#     SECTIONS = []
#     UNPUBLISHED_STATES = [
#         "Draft"
#     ]
#     FEED_TITLE = "Blog"
#     SECTION_FEED_TITLE = "Blog (%s)"
#     MARKUP_CHOICE_MAP = DEFAULT_MARKUP_CHOICE_MAP
#     MARKUP_CHOICES = DEFAULT_MARKUP_CHOICE_MAP
#     SCOPING_MODEL = None
#     SCOPING_URL_VAR = None
#     SLUG_UNIQUE = False
#     PAGINATE_BY = 10
#     HOOKSET = "pinax.blog.hooks.PinaxBlogDefaultHookSet"
#     ADMIN_JS = ("js/admin_post_form.js",)
# class PinaxBlogAppConf(AppConf):
#     class Meta:


# Path: pinax/blog/managers.py
from django.db import models
from django.utils import timezone
from .conf import settings



PUBLISHED_STATE = len(settings.PINAX_BLOG_UNPUBLISHED_STATES) + 1


class PostManager(models.Manager):

    def published(self):
        return self.filter(published__lte=timezone.now(), state=PUBLISHED_STATE)

    def current(self):

        return self.published().order_by("-published")