~panosl/+junk/django-attachments

« back to all changes in this revision

Viewing changes to README.rst

  • Committer: Martin Mahner
  • Date: 2009-05-08 10:49:20 UTC
  • Revision ID: git-v1:2ffcab9fcfc929a7b06773cc19f1cc58f93ac00d
Fixed some typos in the README.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
django-attachments is a generic set of template tags to attach any kind of
6
6
files to models.
7
7
 
8
 
Installattion:
9
 
==============
10
 
 
11
 
Put ``attachments`` to your ``INSTALLED_APPS`` in your ``settings.py`` within
12
 
your django project. This app provides a additional permission ``delete_foreign_attachments``
 
8
Installation:
 
9
=============
 
10
 
 
11
1. Put ``attachments`` to your ``INSTALLED_APPS`` in your ``settings.py``
 
12
   within your django project.
 
13
 
 
14
2. Add ``(r'^attachments/', include('attachments.urls')),`` to your ``urls.py``.
 
15
   
 
16
This app provides a additional permission ``delete_foreign_attachments``
13
17
which enables that users with it can delete foreign attachments. Normally only
14
 
users who uploaded the attachment, can delete it.
 
18
the user who uploaded the attachment can delete it.
15
19
 
16
20
Usage:
17
21
======
38
42
django-attachments comes with some templatetags to add or delete attachments
39
43
for your model objects in your frontend.
40
44
 
41
 
1. **``get_attachments_for [object]``**: Fetches the attachments for the given
 
45
1. ``get_attachments_for [object]``: Fetches the attachments for the given
42
46
   model instance. You can optionally define a variable name in which the attachment
43
47
   list is stored in the template context. The default context variable name is
44
48
   ``attachments`` Example::
45
49
   
46
50
   {% get_attachments_for entry as "attachments_list" %}
47
51
 
48
 
2. **``attachment_form``**: Renders a upload form to add attachments for the given
 
52
2. ``attachment_form``: Renders a upload form to add attachments for the given
49
53
   model instance. Example::
50
54
   
51
55
    {% attachment_form [object] %}
52
56
 
53
57
   It returns an empty string if the current user is not logged in.
54
58
 
55
 
3. **``attachment_delete_link``**: Renders a link to the delete view for the given
 
59
3. ``attachment_delete_link``: Renders a link to the delete view for the given
56
60
   *attachment*. Example::
57
61
   
58
62
    {% for att in attachment_list %}