forked from hzdg/django-enumfields
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from akx/renovate
Renovations
- Loading branch information
Showing
22 changed files
with
161 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,23 @@ on: | |
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
Lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pre-commit/[email protected] | ||
Build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: python -m pip install -U build | ||
- run: python -m build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist/* | ||
Test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
|
@@ -17,9 +30,9 @@ jobs: | |
- python-version: '3.10' | ||
- python-version: '3.11' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: 'Set up Python ${{ matrix.python-version }}' | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '${{ matrix.python-version }}' | ||
cache: pip | ||
|
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,22 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.3.5 | ||
hooks: | ||
- id: ruff | ||
args: | ||
- --fix | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: fix-byte-order-marker | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
args: | ||
- --fix=lf | ||
- repo: https://github.com/crate-ci/typos | ||
rev: v1.18.2 | ||
hooks: | ||
- id: typos |
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
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,2 +1,7 @@ | ||
from .fields import EnumField | ||
from .serializers import EnumSupportSerializerMixin | ||
|
||
__all__ = [ | ||
"EnumField", | ||
"EnumSupportSerializerMixin", | ||
] |
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,5 +1,4 @@ | ||
from django.utils.encoding import force_str | ||
|
||
from rest_framework.fields import ChoiceField | ||
|
||
|
||
|
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
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,60 @@ | ||
# Generated by Django 5.0.4 on 2024-04-09 06:18 | ||
|
||
from django.db import migrations, models | ||
|
||
import enumfields.fields | ||
import tests.enums | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
dependencies = [] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="MyModel", | ||
fields=[ | ||
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("color", enumfields.fields.EnumField(enum=tests.enums.Color, max_length=1)), | ||
( | ||
"color_not_editable", | ||
enumfields.fields.EnumField(editable=False, enum=tests.enums.Color, max_length=1, null=True), | ||
), | ||
("taste", enumfields.fields.EnumField(default=1, enum=tests.enums.Taste, max_length=10)), | ||
( | ||
"taste_not_editable", | ||
enumfields.fields.EnumField(default=1, editable=False, enum=tests.enums.Taste, max_length=10), | ||
), | ||
( | ||
"taste_null_default", | ||
enumfields.fields.EnumField( | ||
blank=True, default=None, enum=tests.enums.Taste, max_length=10, null=True | ||
), | ||
), | ||
("taste_int", enumfields.fields.EnumIntegerField(default=1, enum=tests.enums.Taste)), | ||
( | ||
"default_none", | ||
enumfields.fields.EnumIntegerField(blank=True, default=None, enum=tests.enums.Taste, null=True), | ||
), | ||
("nullable", enumfields.fields.EnumIntegerField(blank=True, enum=tests.enums.Taste, null=True)), | ||
("random_code", models.TextField(blank=True, null=True)), | ||
("zero", enumfields.fields.EnumIntegerField(default=0, enum=tests.enums.ZeroEnum)), | ||
("zero2", enumfields.fields.EnumIntegerField(blank=True, default=0, enum=tests.enums.ZeroEnum)), | ||
( | ||
"int_enum", | ||
enumfields.fields.EnumIntegerField( | ||
blank=True, default=None, enum=tests.enums.IntegerEnum, null=True | ||
), | ||
), | ||
( | ||
"int_enum_not_editable", | ||
enumfields.fields.EnumIntegerField(default=0, editable=False, enum=tests.enums.IntegerEnum), | ||
), | ||
( | ||
"labeled_enum", | ||
enumfields.fields.EnumField(blank=True, enum=tests.enums.LabeledEnum, max_length=10, null=True), | ||
), | ||
], | ||
), | ||
] |
Empty file.
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
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
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