Ejemplo n.º 1
0
def simple_story_dict(user):
    return {
        'title': "Short title for a testing story",
        'slug': "short-title-for-testing-story",
        'body': "This is a the body of the story.",
        'tags': "mobile vikings",
        'author': user,
        'allow_comments': True,
        'site': Config.get_current().site
    }
Ejemplo n.º 2
0
def simple_story_dict(user):
    return {
        'title': "Short title for a testing story",
        'slug': "short-title-for-testing-story",
        'body': "This is a the body of the story.",
        'tags': "mobile vikings",
        'author': user,
        'allow_comments': True,
        'site': Config.get_current().site
    }
Ejemplo n.º 3
0
 def setUp(self):
     self.kwargs = {
         'title': "Short title for a testing story",
         'slug': "short-title-for-testing-story",
         'body': "This is the content of the story.",
         'tags': "mobile vikings",
         'author': User.objects.get(username="******"),
         'allow_comments': True,
         'site': Config.get_current().site
     }
     self.tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
Ejemplo n.º 4
0
 def setUp(self):
     self.kwargs = {
         "title": "Short title for a testing story",
         "slug": "short-title-for-testing-story",
         "body": "This is the content of the story.",
         "tags": "mobile vikings",
         "author": User.objects.get(username="******"),
         "allow_comments": True,
         "site": Config.get_current().site,
     }
     self.tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
Ejemplo n.º 5
0
def config(request):
    """
    Adds configuration information to the context.

    To employ, add the conf method reference to your project
    settings TEMPLATE_CONTEXT_PROCESSORS.

    Example:
        TEMPLATE_CONTEXT_PROCESSORS = (
            ...
            "easy_blog.context_processors.config",
        )
    """
    return {'easy_blog_config': Config.get_current()}
Ejemplo n.º 6
0
 def config(self):
     if self._config is None:
         self._config = Config.get_current()
     return self._config
Ejemplo n.º 7
0
 def get_paginate_by(self, queryset):
     # config = Config.get_current()
     # return config.stories_in_index if config else 5
     return Config.get_current().stories_in_index
Ejemplo n.º 8
0
 def get_paginate_by(self, queryset):
     # config = Config.get_current()
     # return config.stories_in_index if config else 5
     return Config.get_current().stories_in_index