@register.filter(name='rule_member_name')
def rule_member_name(instance, member):
 member = getattr(instance, member)
 names = member.all()
 return names

@ register . filter ( name = 'rule_member_name' ) def rule_member_name ( instance , member ) : member = getattr ( instance , member ) names = member . all ( ) return names
instance is a rule object .