python-docx-template icon indicating copy to clipboard operation
python-docx-template copied to clipboard

Can i pass instance model django to docxtpl

Open Goathemis opened this issue 3 years ago • 1 comments

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.

Goathemis avatar Dec 23 '21 16:12 Goathemis

Without any code, it will be difficult to answer ! May be you forgot a .all() in the queryset you gave into your docxtpl context...

elapouya avatar Dec 30 '21 11:12 elapouya