[Fixed]-Django template get foreign key of queryset

1👍

This question has nothing at all to do with foreign keys or querysets. The error tells you exactly what is going wrong: it is not recognising the “in_country” filter.

Your assertion that “template tags are loaded” because upper works does not follow at all: upper is a built-in filter provided by Django itself, whereas in_country is not. You need to load your template tag library with {% load module_that_defines_filter %} before you can use it.

Leave a comment