Insert a count of attachments into the context
Insert a form for the attachment model instance into the context
Insert a form for the attachment model into the context
Insert a list of attachments into the context
Base helper class for handling the get_attachment_* template tags. Modelled after the contrib.comments framework
Subclasses should override this.
Class method to parse get_attachment_list/count/form and return a Node
Render the edit form directly
Render the attachment form directly
Class method to parse render_comment_form and return a Node.
Render the attachment list directly
Class method to parse render_attachment_list and return a Node.
Gets the attachment count for the given params and populates the template context with a variable containing that value, whose name is defined by the ‘as’ clause.
Syntax:
{% get_attachment_count for [object] as [varname] %}
{% get_attachment_count for [app].[model] [object_id] as [varname] %}
Example usage:
{% get_attachment_count for event as comment_count %}
{% get_attachment_count for calendar.event event.id as comment_count %}
{% get_attachment_count for calendar.event 17 as comment_count %}
Get a modelform object to edit an existing attachment.
Syntax:
{% get_attachment_editform for [object] as [varname] %}
{% get_attachment_editform for [app].[model] [object_id] as [varname] %}
Get a (new) form object to upload a new attachment.
Example usage:
{% get_attachment_form for [object] as [varname] %}
{% get_attachment_form for [app].[model] [object_id] as [varname] %}
Gets the list of attachments for the given params and populates the template context with a variable containing that value, whose name is defined by the ‘as’ clause.
Syntax:
{% get_attachment_list for [object] as [varname] %}
{% get_attachment_list for [app].[model] [object_id] as [varname] %}
Example usage:
{% get_attachment_list for event as attachment_list %}
{% for attachment in attachment_list %}
...
{% endfor %}
Get the target URL for the attachment form.
Example:
<form action="{% get_create_target %}" method="post">
Get the delete URL for an attachment.
Example:
<a href="{% get_delete_url attachment %}">delete</a>
Get the download URL for an attachment.
Example:
<a href="{% get_download_url attachment %}">download</a>
Get the edit URL for an attachment.
Example:
<a href="{% get_edit_target attachment %}">edit</a>
Get the edit URL for an attachment.
Example:
<a href="{% get_edit_url attachment %}">edit</a>
Get the view URL for an attachment.
Example:
<a href="{% get_view_url attachment %}">view</a>
Render the attachment form (as returned by {% render_attachment_editform %}) through the attachments/editform.html template.
Syntax:
{% render_attachment_editform for [object] %}
{% render_attachment_editform for [app].[model] [object_id] %}
Render the attachment form (as returned by {% render_attachment_form %}) through the attachments/form.html template.
Syntax:
{% render_attachment_form for [object] %}
{% render_attachment_form for [app].[model] [object_id] %}
Render the attachment list (as returned by {% get_attachment_list %}) through the attachments/list.html template
Syntax:
{% render_attachment_list for [object] %}
{% render_attachment_list for [app].[model] [object_id] %}
Example usage:
{% render_attachment_list for event %}