--- /dev/null
+========================
+Django Postman changelog
+========================
+
+Version 2.0.0, August 2012
+--------------------------
+* Add an API.
+* Rename the extra context variables passed to the notifier app to avoid name clash:
+ pm_message and pm_action
+* More adjustments for Django 1.4.
+* Change medias/ to static/ for conformance with django 1.3.
+* Adjustments for integration with version 1.2.x of django-ajax-selects, in addition to 1.1.x:
+ - Rename autocomplete_postman_*.html as autocomplete_postman_*_as1-1.html
+ to make clear that they are for django-*a*jax-*s*elects app version 1.1.x.
+ - Replace the template variable 'is_autocompleted' (a boolean) by 'autocompleter_app'
+ (a dictionary with keys: 'is_active', 'name' and 'version').
+* Add this CHANGELOG file.
+
+Version 1.2.0, March 2012
+-------------------------
+* Improve the or_me filter, in relation with issue #5.
+* Improve the autopagination performance.
+* First adjustments for Django 1.4.
+
+Version 1.1.0, January 2012
+---------------------------
+* Add POSTMAN_DISABLE_USER_EMAILING.
+* No need for an immediate rejection notification for a User.
+* Add an ordering criteria.
+
+Version 1.0.1, January 2011
+---------------------------
+* Fix issue #1.
+
+Version 1.0.0, January 2011
+---------------------------
+* Initial release.
\ No newline at end of file
--- /dev/null
+API\r
+===\r
+\r
+For an easier usage of the application from other applications in the project,\r
+an API is provided.\r
+\r
+pm_broadcast()\r
+--------------\r
+Broadcast a message to multiple Users.\r
+\r
+For an easier cleanup, all these messages are directly marked as archived and deleted on the sender side.\r
+\r
+Arguments: (sender, recipients, subject, body='', skip_notification=False)\r
+\r
+pm_write()\r
+----------\r
+Write a message to a User.\r
+\r
+Contrary to pm_broadcast(), the message is archived and/or deleted on the sender side only if requested.\r
+\r
+Arguments: (sender, recipient, subject, body='', skip_notification=False, auto_archive=False, auto_delete=False)\r
+\r
+Arguments\r
+---------\r
+* ``auto_archive``: to mark the message as archived on the sender side\r
+* ``auto_delete``: to mark the message as deleted on the sender side\r
+* ``body``: the contents of the message\r
+* ``recipient``: a User instance\r
+* ``recipients``: a list or tuple of User instances, or a single User instance\r
+* ``sender``: a User instance\r
+* ``skip_notification``: if the normal notification event is not wished\r
+* ``subject``: the subject of the message\r
+\r
+Example\r
+-------\r
+Suppose an application managing Event objects. Whenever a new Event is generated,\r
+you want to broadcast an announcement to Users who have subscribed\r
+to be informed of the availability of such a kind of Event.\r
+\r
+Code sample::\r
+\r
+ from postman.api import pm_broadcast\r
+ events = Event.objects.filter(...)\r
+ for e in events:\r
+ pm_broadcast(\r
+ sender=e.author,\r
+ recipients=e.subscribers,\r
+ subject='New {0} at Our School: {1}'.format(e.type, e.title),\r
+ body=e.description)\r
\r
Example::\r
\r
- <a href="{% url postman_write username %}">write to {{ username }}</a>\r
+ <a href="{% url 'postman_write' username %}">write to {{ username }}</a>\r
\r
Separate multiple usernames with a ``:`` character.\r
\r
Example::\r
\r
- <a href="{% url postman_write 'adm1:adm2:adm3' %}">write to admins</a>\r
+ <a href="{% url 'postman_write' 'adm1:adm2:adm3' %}">write to admins</a>\r
\r
Prefilled fields\r
----------------\r
\r
Example::\r
\r
- <a href="{% url postman_write %}?subject=details request&body=give me details about ...">\r
+ <a href="{% url 'postman_write' %}?subject=details request&body=give me details about ...">\r
ask for details\r
</a>\r
\r
'arg_default': 'postman_users',\r
}\r
\r
-Support for multiple recipients is not turned on by default by `django-ajax-selects`_.\r
-To allow this capability, you have to pass the option ``multiple: true``.\r
+In case of version 1.1.4/5 of django-ajax-selects:\r
+\r
+ Support for multiple recipients is not turned on by default by `django-ajax-selects`_.\r
+ To allow this capability, you have to pass the option ``multiple: true`` to jquery-plugin-autocomplete.\r
\r
.. _`django-ajax-selects`: http://code.google.com/p/django-ajax-selects/\r
\r
-Make your own templates, based on these two files, given as implementation examples:\r
+ Make your own templates, based on these two files, given as implementation examples:\r
+\r
+ * :file:`postman/templates/autocomplete_postman_multiple_as1-1.html`\r
+ * :file:`postman/templates/autocomplete_postman_single_as1-1.html`\r
+\r
+ These examples include a correction necessary for the support of the 'multiple' option.\r
+\r
+In case of version 1.2.x of django-ajax-selects:\r
+\r
+ Refer to the installation guide of this application, in particular the use of AJAX_SELECT_BOOTSTRAP\r
+ and AJAX_SELECT_INLINES.\r
+ Support for multiple recipients is not as simple as an option: see the examples in the `jQuery UI demos`_.\r
\r
-* :file:`postman/templates/autocomplete_postman_multiple.html`\r
-* :file:`postman/templates/autocomplete_postman_single.html`\r
+.. _`jQuery UI demos`: http://jqueryui.com/demos/autocomplete/multiple-remote.html\r
\r
-These examples include a correction necessary for the support of the 'multiple' option\r
-(in version 1.1.4 of django-ajax-selects).\r
+ The directory `postman/templates/` doesn't currently provide any examples for this version.\r
\r
Customization\r
~~~~~~~~~~~~~\r
features\r
tags-filters\r
management\r
+ api\r
faq\r
\r
Indices and tables\r
\r
It can be run as a cron job or directly.\r
\r
-A :option:`--days` option can be used to specify the minimal number of days a message/conversation\r
+The :option:`--days` option can be used to specify the minimal number of days a message/conversation\r
must have been marked for deletion.\r
Default value is 30 days.\r
\r
\r
Parties should be notified of these events:\r
\r
-* when a message is rejected\r
-* when a message or a reply is received\r
+* when a message is rejected (sender)\r
+* when a message or a reply is received (recipient)\r
\r
.. _for_visitors:\r
\r
Some extra context variables are passed in the call to the notifier application\r
and so are available in the templates:\r
\r
-* ``message``: the Message instance\r
-* ``action``: 'rejection' or 'acceptance'\r
+* ``pm_message``: the Message instance\r
+* ``pm_action``: 'rejection' or 'acceptance'\r
\r
If no notifier application is used, an email is sent, using these templates:\r
\r
You may use it as it is with a CSS design of yours, re-use it or extend some parts of it,\r
or only view it as an example.\r
\r
+You may need to adjust some templates to match your version of Django.\r
+Permute the comment tags for the lines denoted by the marks: {# dj v1.x #} in:\r
+\r
+* base_write.html\r
+\r
+In case you run a Django 1.2 version, perform these additional steps for any template:\r
+\r
+* Remove {% load url from future %}\r
+* Change any {% url 'XX' %} to {% url XX %}\r
+\r
Relations between templates::\r
\r
base.html\r
| |_ reply.html\r
|_ view.html\r
\r
-If the django-ajax-selects application is used, the following URLs are referenced by this set:\r
+If the autocomplete application is django-ajax-selects in version 1.1.4 or 1.1.5, the following URLs are referenced by this set:\r
\r
-* {% admin_media_prefix %}js/jquery.min.js\r
-* {{ MEDIA_URL }}js/jquery.autocomplete.min.js\r
-* {{ MEDIA_URL }}css/jquery.autocomplete.css\r
-* {{ MEDIA_URL }}css/indicator.gif\r
+* js/jquery.min.js\r
+* js/jquery.autocomplete.min.js\r
+* css/jquery.autocomplete.css\r
+* css/indicator.gif\r
+\r
+You may have to adjust the path prefix with your version of Django:\r
+{{ MEDIA_URL }} or {{ STATIC_URL }} or {% admin_media_prefix %} or {% static '... %} or {% static 'admin/... %}.\r
+\r
+These files are part of the requirements of django-ajax-selects version 1.1.x and\r
+it's up to you to make them accessible in your project (they are not provided by the django-postman app).\r
\r
The :file:`postman/base.html` template extends a :file:`base.html` site template,\r
in which some blocks are expected:\r
* content: in <html><body>, to put the page contents\r
* postman_menu: in <html><body>, to put a navigation menu\r
\r
-Medias\r
-~~~~~~\r
+Static Files\r
+~~~~~~~~~~~~\r
A CSS file is provided with the application, for the Admin site: :file:`postman/css/admin.css`.\r
It is not obligatory but makes the display more confortable.\r
\r
-The file is provided under :file:`postman/medias/`. It's up to you to make it visible to the URL resolver.\r
+The file is provided under :file:`postman/static/`.\r
+\r
+For Django 1.3+, just follow the instructions related to the staticfiles app.\r
+\r
+For Django 1.2:\r
+ It's up to you to make it visible to the URL resolver.\r
\r
-For example:\r
+ For example:\r
\r
-* In a production environment, set :file:`/<MEDIA_URL>/postman/` as a symlink to :file:`<Postman_module>/medias/postman/`\r
-* In a development environment (django's runserver), you can put in the URLconf, something like::\r
+ * Rename the path to :file:`postman/medias/`\r
+ * In a production environment, set :file:`/<MEDIA_ROOT>/postman/` as a symlink to :file:`<Postman_module>/medias/postman/`\r
+ * In a development environment (django's runserver), you can put in the URLconf, something like::\r
\r
- ('^' + settings.MEDIA_URL.strip('/') + r'/(?P<path>postman/.*)$', 'django.views.static.serve',\r
- {'document_root': os.path.join(imp.find_module('postman')[1], 'medias')}),\r
+ ('^' + settings.MEDIA_URL.strip('/') + r'/(?P<path>postman/.*)$', 'django.views.static.serve',\r
+ {'document_root': os.path.join(imp.find_module('postman')[1], 'medias')}),\r
\r
See also :ref:`styles` for the stylesheets of views.\r
\r
\r
Example::\r
\r
- <a href="{% url postman_reply reply_to_pk %}?next={{ next_url|urlencode }}">Reply</a>\r
+ <a href="{% url 'postman_reply' reply_to_pk %}?next={{ next_url|urlencode }}">Reply</a>\r
\r
reply formatters\r
----------------\r