Skip to content

Reports and Tags -> AttributeError: _TaggableManager #6444

Answered by candlerb
martinum4 asked this question in Q&A
Discussion options

You must be logged in to vote

Can i "dry run" a report with python directly when i try to debug it?

You can run a report from the command line. You can also use nbshell to interact with the python models interactively, for finding out how these things work.

I don't know what you mean by "dry run" in this context - reports should not be making any changes to the database.

So, how can i query for the tags correctly? Is it even possible?

Yes, of course it's possible: Netbox does it :-)

>>> d = Device.objects.get(id=1)
>>> d
<Device: nuc1>
>>> d.tags
<taggit.managers._TaggableManager object at 0x7f967691c470>
>>> d.tags.all()
<RestrictedQuerySet [<Tag: prom_node>]>
>>> d.tags.all()[0]
<Tag: prom_node>
>>> d.tags.all()…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@martinum4
Comment options

Answer selected by martinum4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants