This is a contrived example of what i’m asking for:
random_list = []
random_uuid = "1234567890-1234567890"
model_instance = Model.objects.filter(related_link=random_uuid)
for x in ['foo', 'bar', 'ray', 'mee']:
random_list.append(model_instance.x)
The three obligatory questions:
- Is this possible?
- If so how?
- Are there any downsides?
Sure, just use getattr: