@register.simple_tag<EOL>def numRegisteredForRoleName(event, roleName):
if not isinstance(event, Event):<EOL><INDENT>return None<EOL><DEDENT>try:<EOL><INDENT>role = DanceRole.objects.get(name=roleName)<EOL><DEDENT>except ObjectDoesNotExist:<EOL><INDENT>return None<EOL><DEDENT>return event.numRegisteredForRole(role)<EOL>
This tag allows one to access the number of registrations
for any dance role using only the role's name.