\r
**I don't want to bother with the moderation feature, how to bypass it?**\r
Set the configuration option::\r
- \r
+\r
POSTMAN_AUTO_MODERATE_AS = True\r
-
\ No newline at end of file
+\r
+**I installed django-pagination, and still I don't see any pagination widgets**\r
+\r
+* Is there really more messages than one page capacity (default is 20)?\r
+* Check that ``pagination`` is declared before ``postman`` in the ``INSTALLED_APPS`` setting.\r
+* See if it's better by disabling :file:`postman/templatetags/pagination_tags.py` and :file:`.pyc` (rename or move the files).\r
* :file:`postman_admin_modify.py`: a library exclusively designed for a customized change_form\r
template used in the Admin site for the moderation of pending messages.\r
\r
-* :file:`pagination_tags_for_tests.py`: a mock of the django-pagination application template tags,\r
- only usable for the test suite in case the real application is not installed.\r
- To rename to :file:`pagination_tags.py` during the test session.\r
+* :file:`pagination_tags.py`: a mock of the django-pagination application template tags.\r
+ For convenience, the design of the default template set is done with the use of that application.\r
+ The mock will avoid failures in template rendering if the real application is not installed,\r
+ as it may be the case for the test suite run in a minimal configuration.\r
+ To deactivate the mock and use the real implementation, just make sure that ``pagination`` is declared\r
+ before ``postman`` in the ``INSTALLED_APPS`` setting.\r
\r
Tags\r
----\r
{% extends "postman/base.html" %}
{% load url from future %}
-{% load i18n postman_tags %}{% load pagination_tags %}
+{% load i18n postman_tags %}{% load pagination_tags %}{% comment %}
+WARNING: 'pagination_tags' is a name from the django-pagination application.
+For convenience, the design of this template is done with the use of that application.
+Django-postman will still be working, even if that application is not installed, by providing a mock
+for the template tag library.
+If the real implementation is to be used, just make sure that 'pagination' is declared before 'postman'
+in the INSTALLED_APPS setting.
+{% endcomment %}
{% block content %}
<div id="postman">
<h1>{% block pm_folder_title %}{% endblock %}</h1>
--- /dev/null
+"""
+A mock of django-pagination's pagination_tags.py that does nothing.
+
+'pagination_tags' is a name from the django-pagination application.
+For convenience, the design of the default template set is done with the use of that application.
+This mock will avoid failures in template rendering if the real application is not installed,
+as it may be the case for the test suite run in a minimal configuration.
+
+To deactivate this mock and use the real implementation, just make sure that 'pagination' is declared
+before 'postman' in the INSTALLED_APPS setting.
+"""
+from django.template import Node, Library
+
+register = Library()
+
+class AutoPaginateNode(Node):
+ def render(self, context):
+ return u''
+
+@register.tag
+def autopaginate(parser, token):
+ return AutoPaginateNode()
+
+class PaginateNode(Node):
+ def render(self, context):
+ return u''
+
+@register.tag
+def paginate(parser, token):
+ return PaginateNode()
+++ /dev/null
-"""
-A mock of django-pagination's pagination_tags.py that do nothing.
-Just to avoid failures in template rendering during the test suite,
-if the real application is not installed.
-
-To activate this mock, just rename it to ``pagination_tags.py``
-for the time of the test session.
-"""
-from django.template import Node, Library
-
-register = Library()
-
-class AutoPaginateNode(Node):
- def render(self, context):
- return u''
-
-@register.tag
-def autopaginate(parser, token):
- return AutoPaginateNode()
-
-class PaginateNode(Node):
- def render(self, context):
- return u''
-
-@register.tag
-def paginate(parser, token):
- return PaginateNode()
# because of reload()'s, do "from postman.utils import notification" just before needs
from postman.utils import format_body, format_subject
-if not 'pagination' in settings.INSTALLED_APPS:
- try:
- import postman.templatetags.pagination_tags
- except:
- sys.exit(
- "Some templates need templatetags from the django-pagination application.\n"
- "Add it to the INSTALLED_APPS, or allow a mock by renaming\n"
- "postman/templatetags/pagination_tags_for_tests.py to pagination_tags.py"
- )
-
class GenericTest(TestCase):
"""
Usual generic tests.