-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
273e582
commit 031dbd5
Showing
10 changed files
with
347 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
from .fields import IntegerChoicesField, TextChoicesField | ||
from .types import IntegerChoicesFlag | ||
|
||
__all__ = [ | ||
"IntegerChoicesFlag", | ||
"TextChoicesField", | ||
"IntegerChoicesField", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import enum | ||
import sys | ||
from typing import TYPE_CHECKING | ||
|
||
from django.db import models | ||
from typing_extensions import Self | ||
|
||
|
||
class IntegerChoicesFlag(models.IntegerChoices, enum.Flag): | ||
"""Enumerated integer choices.""" | ||
|
||
if TYPE_CHECKING: | ||
|
||
def __or__(self, other: Self) -> Self: | ||
... | ||
|
||
def __and__(self, other: Self) -> Self: | ||
... | ||
|
||
def __xor__(self, other: Self) -> Self: | ||
... | ||
|
||
def __invert__(self) -> Self: | ||
... | ||
|
||
if sys.version_info >= (3, 11): | ||
__ror__ = __or__ | ||
__rand__ = __and__ | ||
__rxor__ = __xor__ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "django-choices-field" | ||
version = "2.1.2" | ||
version = "2.2.0" | ||
description = "Django field that set/get django's new TextChoices/IntegerChoices enum." | ||
authors = ["Thiago Bellini Ribeiro <[email protected]>"] | ||
license = "MIT" | ||
|
@@ -32,6 +32,7 @@ packages = [{ include = "django_choices_field" }] | |
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
django = ">=3.2" | ||
typing_extensions = ">=4.0.0" | ||
|
||
[tool.poetry.dev-dependencies] | ||
black = "^23.3.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.