def extract_email_senior(): query_clauses = [ ('Member', 'status', [s.value for s in MemberStatus.all_active()], 'in', None), ('Member', 'member_type', [s.value for s in MembershipType.adult()], 'in', None), ('Member', 'comms', CommsType.email.value, '=', None), ('Member', 'comms_status', CommsStatus.all_ok.value, '=', None) ] display_fields = ['number', 'first name', 'email'] return Query.show_found_do(query_clauses, display_fields)
def is_adult(self): return self.member_type in MembershipType.adult()