def unread_count_for(user):
 return InboxMessage.objects.filter(to=user, read=False).count()

def unread_count_for ( user ) : return InboxMessage . objects . filter ( to = user , read = False ) . count ( )
returns the number of unread messages for the specified user .