Project
Project Model Variables for Template Customization
The Project
model in APTRS contains the following fields that can be used as template variables in your custom report templates. These variables are passed as part of the context to the report HTML, allowing you to display or manipulate project-related data in your custom reports.
Available Variables and Their Usage
-
project.name
- Represents the name of the project.
- Example usage in HTML:
HTML<h1>Project Name: {{ project.name }}</h1>
-
project.companyname
- A foreign key to the
Company
model, representing the company associated (Customer Company) with the project. - Example usage:
HTML<p>Company Name: {{ project.companyname.name }}</p>
- A foreign key to the
-
project.description
- A detailed description of the project.
- Example usage:
HTML<p>Description: {{project.description|clean_html}}</p>
- It uses CKeditor HTML data, using
|clean_html
allow to render html data securely instead of as text.
-
project.projecttype
- Specifies the type of project.
- Example usage:
HTML<p>Project Type: {{ project.projecttype }}</p>
-
project.startdate
- The start date of the project.
- Example usage:
HTML<p>Start Date: {{ project.startdate }}</p>
- You can also modify the date format
HTML
<p>Start Date: {{project.startdate|date:"d/m/Y" }} </p>
-
project.enddate
- The end date of the project.
- Example usage:
HTML<p>End Date: {{ project.enddate }}</p>
- You can also modify the date format
HTML
<p>End Date: {{project.enddate|date:"d/m/Y" }} </p>
-
project.testingtype
- The type of testing performed for the project (e.g., White Box, Black Box).
- Example usage:
HTML<p>Testing Type: {{ project.testingtype }}</p>
-
project.projectexception
- Notes or exceptions for the project, if any.
- Example usage:
HTML<p>Exceptions: {{ project.projectexception|clean_html }}</p>
- It uses CKeditor HTML data, using
|clean_html
allow to render html data securely instead of as text. - In most cases if you don't have exceptions and in your report you only this if exception is there you are also do it with conditions.
HTML
{% if project.projectexception %} <p>Exceptions: {{ project.projectexception|clean_html }}</p> {% endif %}
-
project.owner
- A many-to-many relationship representing users associated as owners of the project.
- To display all owners:
HTML<ul> {% for owner in project.owner.all %} <li>{{ owner.username }}</li> <li>{{ owner.full_name }} </li> <td>{{ owner.email }} </li> <li>{{ owner.number }} </li> <li>{{ owner.position }} </li> {% endfor %} </ul>
-
project.status
- The current status of the project, based on
PROJECT_STATUS_CHOICES
(e.g., Upcoming, In Progress, Delay, Completed). - Example usage:
HTML<p>Status: {{ project.status }}</p>
- The current status of the project, based on