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 Docx, 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:
PythonProject Name: {{ project.name }}
-
project.companyname
- A foreign key to the
Company
model, representing the company associated (Customer Company) with the project. - Example usage:
PythonCompany Name: {{ project.companyname.name }}
- A foreign key to the
-
project_exception
- A detailed description of the project.
- Example usage:
PythonDescription: {{p project_exception}}
- It uses CKeditor HTML data, its converted into the docx format from HTML, hence its required to use
p
at the start of the tag.
-
project.projecttype
- Specifies the type of project.
- Example usage:
PythonProject Type: {{ project.projecttype }}
-
project.startdate
- The start date of the project.
- Example usage:
PythonStart Date: {{ project.startdate }}
- You can also modify the date format
Python
Project Start Date: {{ project.startdate.strftime("%d/%m/%Y") }}
-
project.enddate
- The end date of the project.
- Example usage:
Python<End Date: {{ project.enddate }}
- You can also modify the date format
Python
Project End Date: {{project.enddate.strftime("%d/%m/%Y") }}
-
project.testingtype
- The type of testing performed for the project (e.g., White Box, Black Box).
- Example usage:
PythonTesting Type: {{ project.testingtype }}
-
project_exception
- Notes or exceptions for the project, if any.
- Example usage:
PythonExceptions: {{p project_exception }}
- It uses CKeditor HTML data, its converted into the docx format from HTML, hence its required to use
p
at the start of the tag. - 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.
Python
{% if project_exception %} Exceptions: {{p project_exception }} {% endif %}
-
project.owner
- Note: This is not available, due to issues with the method provided by django to loop many to many database relation, it does not work with the jinja2.
-
project.status
- The current status of the project, based on
PROJECT_STATUS_CHOICES
(e.g., Upcoming, In Progress, Delay, Completed). - Example usage:
PythonStatus: {{ project.status }}
- The current status of the project, based on
In order to get Project owner details, APTRS provide a seperate context and tag owners
which contain user details for project owners. In order to use it you have to loop through details like below:
Python
{% for owner in owners %}
{{ owner.full_name}}
{{ owner.email}}
{{ owner.position}}
{{ owner.number}}
{% endfor %}