Blame bugzilla/bugzilla4.py

Packit 436967
#
Packit 436967
# Copyright (C) 2008-2012 Red Hat Inc.
Packit 436967
# Author: Michal Novotny <minovotn@redhat.com>
Packit 436967
#
Packit 436967
# This program is free software; you can redistribute it and/or modify it
Packit 436967
# under the terms of the GNU General Public License as published by the
Packit 436967
# Free Software Foundation; either version 2 of the License, or (at your
Packit 436967
# option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
Packit 436967
# the full text of the license.
Packit 436967
Packit 436967
from bugzilla.bugzilla3 import Bugzilla36
Packit 436967
Packit 436967
Packit 436967
class Bugzilla4(Bugzilla36):
Packit 436967
    bz_ver_major = 4
Packit 436967
    bz_ver_minor = 0
Packit 436967
Packit 436967
Packit 436967
    #################
Packit 436967
    # Query Methods #
Packit 436967
    #################
Packit 436967
Packit 436967
    def build_query(self, **kwargs):
Packit 436967
        query = Bugzilla36.build_query(self, **kwargs)
Packit 436967
Packit 436967
        # 'include_fields' only available for Bugzilla4+
Packit 436967
        include_fields = self._convert_include_field_list(
Packit 436967
            kwargs.pop('include_fields', None))
Packit 436967
        if include_fields:
Packit 436967
            if 'id' not in include_fields:
Packit 436967
                include_fields.append('id')
Packit 436967
            query["include_fields"] = include_fields
Packit 436967
Packit 436967
        exclude_fields = self._convert_include_field_list(
Packit 436967
            kwargs.pop('exclude_fields', None))
Packit 436967
        if exclude_fields:
Packit 436967
            query["exclude_fields"] = exclude_fields
Packit 436967
Packit 436967
        return query
Packit 436967
Packit 436967
Packit 436967
class Bugzilla42(Bugzilla4):
Packit 436967
    bz_ver_minor = 2
Packit 436967
Packit 436967
Packit 436967
class Bugzilla44(Bugzilla42):
Packit 436967
    bz_ver_minor = 4