@staticmethod
def query_group(q_object, args):
    """
        Subselect to filter data nodes by their group.

        :param q_object: a query object
        :param args: a namespace with parsed command line parameters.
        """
    from django.db.models import Q
    if args.group_name is not None:
        q_object.add(Q(dbgroups__name__in=args.group_name), Q.AND)
    if args.group_pk is not None:
        q_object.add(Q(dbgroups__pk__in=args.group_pk), Q.AND)
