Skip to content

Jinja templates - what object properties are available? #12568

Discussion options

You must be logged in to vote

You can check the code:

ip_addresses = GenericRelation(
to='ipam.IPAddress',
content_type_field='assigned_object_type',
object_id_field='assigned_object_id',
related_query_name='interface'
)

Alternatively you can print all the fields on the model you are working with in nbshell:

print([f"{f.name} - {type(f).__name__}" for f in Interface._meta.get_fields()])

['child_interfaces - ManyToOneRel',
 'bridge_interfaces - ManyToOneRel',
 'member_interfaces - ManyToOneRel',
 'id - BigAutoField',
 'created - DateTimeField',
 'last_updated - DateTimeField',
 'custom_field_data - JSON…

Replies: 8 comments 28 replies

Comment options

You must be logged in to vote
2 replies
@etfz
Comment options

@candlerb
Comment options

Answer selected by etfz
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
9 replies
@kkthxbye-code
Comment options

@robertmain
Comment options

@zndrr
Comment options

@kkthxbye-code
Comment options

@zndrr
Comment options

Comment options

You must be logged in to vote
6 replies
@robertmain
Comment options

@candlerb
Comment options

@zndrr
Comment options

@candlerb
Comment options

@ross-cello
Comment options

Comment options

You must be logged in to vote
10 replies
@ross-cello
Comment options

@candlerb
Comment options

@kkthxbye-code
Comment options

@candlerb
Comment options

@ross-cello
Comment options

Comment options

You must be logged in to vote
1 reply
@ross-cello
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
8 participants