#NEWLINE# def get_claim_groups( self , badge ) : #NEWLINE# #INDENT# 'Build a list of all known claim group IDs for a badge' #NEWLINE# qs = self . filter ( badge = badge ) . values ( 'claim_group' ) . distinct ( ) . all ( ) . annotate ( modified = Max ( 'modified' ) , count = Count ( 'id' ) ) #NEWLINE# return [ x for x in qs if x [ 'claim_group' ] ]