Skip to content

Jinja2 export template generates incorrectly value 'core.ObjectType.None' of field object_types on extras.custom-fields model #17687

Discussion options

You must be logged in to vote

Hello, Brian!

      Thanks for the response. My goal is to export the data from custom_field model in a format that can be imported without any changes or processing in netbox.

      I just changed my export template to generate a single line, comma separated, object_types:
{% for field in queryset %}name: {{ field.name }}
type: {{ field.type }}
search_weight: {{ field.search_weight }}
filter_logic: {{ field.filter_logic }}
weight: {{ field.weight }}
object_types: {% for type in field.object_types.all() %}{{ type.app_label }}.{{ type.model }}{{ "," if not loop.last }}{% endfor %}
{{ "---
" if not loop.last }}{% endfor %}

The result is the following:

name: SAP_Nummer
type: text
search_w…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@marcusyuri
Comment options

@candlerb
Comment options

@marcusyuri
Comment options

Answer selected by marcusyuri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #17678 on October 07, 2024 16:31.