Annotated objects
Fastview uses annotated objects to provide additional functionality and syntactic sugar when building templates.
An AnnotatedObject is accessed in the template as annotated_object, or in a list
view as objects in the list annotated_objects.
It has the following attributes:
original- reference to the original objectlabels- list of field labelsvalues- list of field values (same order aslabels)items- list of(label, value)pairs
When used in a viewgroup, it also has object-based permission checks:
can_<action>- returnsTrueorFalsebased on user permissions.get_<action>_url- returns the URL to the action.
For example:
{% if annotated_object.can_delete %}
<a href="{{ annotated_object.get_delete_url }}">Delete</a>
{% endif %}
Note: in a future release, the object and object_list context values will be
replaced by the annotated objects, and the annotated_object context values will be
deprecated then removed.