Skip to content

Commit

Permalink
Change: Move SortOrder to pontos.github.model.base
Browse files Browse the repository at this point in the history
SortOrder is either desc or asc and can be used at several places in the
GitHub API. Therefore it is a base model class.
  • Loading branch information
bjoernricks committed Oct 2, 2023
1 parent ba7f8c9 commit 23c100b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
14 changes: 14 additions & 0 deletions pontos/github/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"FileStatus",
"GitHubModel",
"Permission",
"SortOrder",
"Team",
"TeamPrivacy",
"TeamRole",
Expand Down Expand Up @@ -306,3 +307,16 @@ class Event(Enum):
WORKFLOW_CALL = "workflow_call"
WORKFLOW_DISPATCH = "workflow_dispatch"
WORKFLOW_RUN = "workflow_run"


class SortOrder(Enum):
"""
Sort order: asc or desc
Attributes:
ASC: Use ascending sort order
DESC: Use descending sort order
"""

ASC = "asc"
DESC = "desc"
22 changes: 6 additions & 16 deletions pontos/github/models/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


from abc import ABC
from enum import Enum

from .base import SortOrder

__all__ = (
"InDescriptionQualifier",
"InNameQualifier",
Expand All @@ -31,22 +37,6 @@
"UserQualifier",
)

from abc import ABC
from enum import Enum


class SortOrder(Enum):
"""
Sort order: asc or desc
Attributes:
ASC: Use ascending sort order
DESC: Use descending sort order
"""

ASC = "asc"
DESC = "desc"


class RepositorySort(Enum):
"""
Expand Down

0 comments on commit 23c100b

Please sign in to comment.