From 9463622d3e41e9a5962f64b7874b12a9f554dc14 Mon Sep 17 00:00:00 2001 From: tcaiazza Date: Mon, 5 Apr 2021 11:06:55 -0400 Subject: [PATCH] Update export-templates.md --- docs/additional-features/export-templates.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/additional-features/export-templates.md b/docs/additional-features/export-templates.md index 1e0611f06..954aa8506 100644 --- a/docs/additional-features/export-templates.md +++ b/docs/additional-features/export-templates.md @@ -18,6 +18,14 @@ Height: {{ rack.u_height }}U To access custom fields of an object within a template, use the `cf` attribute. For example, `{{ obj.cf.color }}` will return the value (if any) for a custom field named `color` on `obj`. +Since local_context_data is part of an object, it is immediately available to use in the export template, however if you need the fully rendered context config you'll need to use the function `get_config_context`. For example: +``` +{% for server in queryset %} +{% set data = server.get_config_context() %} +{{data.syslog}} +{% endfor %} +``` + A MIME type and file extension can optionally be defined for each export template. The default MIME type is `text/plain`. ## Example