def get_games_for_module(module, active_only=False):
    """
    For a given module return a queryset of related game postings.
    """
    queryset = module.gameposting_set.all()
    if active_only:
        queryset = queryset.exclude(status__in=['closed', 'cancel'])
    return queryset