python-docx-template
python-docx-template copied to clipboard
Can i pass instance model django to docxtpl
i using docxtpl with django project but i cannot pass instance to docxtpl that showing error "'MyInstance' object is not iterable"
cause of why i use instance . i have a many relationship such as ForeignkeyField ManytoManyField and i have a model method for calculate something in model. if i covert to dict model method is not working.
help me pls.
Without any code, it will be difficult to answer ! May be you forgot a .all() in the queryset you gave into your docxtpl context...