[Answer]-In Django, I seem to really need dynamic field names. What am I doing wrong?

1👍

Aha! What I wanted here was getattr, which does exactly this, and is a Python affair rather than a Django one.

This page explained it helpfully: http://effbot.org/zone/python-getattr.htm – essentially, these lines are equivalent:

value = obj.attribute;   

and

value = getattr(obj, "attribute")

Leave a comment