Is there a way to reference a model’s ManyToMany, Related, ForeignKey fields through a variable?
For example
Class Video (models.Model):
owner = models.ForeignKey(User, related_name='videos')
var v = 'videos'
userObj = User.objects.get(username='bob')
userObj.v.filter(...)
I want to do this so I can pass those managers into a method and call them on some instance later.
Use
getattrto get an attribute via a string.