Commit Graph

27 Commits

Author SHA1 Message Date
mahmoudmostafa0
e49a01c189
adding optional_field in Serializermutation to enfore some fields to be optional (#1455)
* adding optional_fields to enforce fields to be optional

* adding support for all

* adding unit tests

* Update graphene_django/rest_framework/mutation.py

Co-authored-by: Kien Dang <kiend@pm.me>

* linting

* linting

* add missing import

---------

Co-authored-by: Kien Dang <kiend@pm.me>
2023-08-28 00:15:35 +03:00
Kien Dang
79b4a23ae0
Miscellaneous CI fixes (#1447)
* Update Makefile

* django master requires at least python 3.10 now

* Allow customizing options passed to tox -e pre-commit

* py.test -> pytest

* Update ruff

* Fix E721

Do not compare types, use `isinstance()`

* Add back black to dev dependencies

* Pin black and ruff versions
2023-08-09 20:48:42 +03:00
Kien Dang
9a773b9d7b
Use ruff in pre-commit (#1441)
* Use ruff in pre-commit

* Add pyupgrade

* Add isort

* Add bugbear

* Fix B015 Pointless comparison

* Fix B026

* B018 false positive

* Remove flake8 and isort config from setup.cfg

* Remove black and flake8 from dev dependencies

* Update black

* Show list of fixes applied with autofix on

* Fix typo

* Add C4 flake8-comprehensions

* Add ruff to dev dependencies

* Fix up
2023-08-06 01:47:00 +03:00
Nikolai Røed Kristiansen
4517e32224
👷 Add pre-commit (#1336)
* 🔧 Add pre-commit config

Similar to graphene and graphene-sqlalchemy

* ⬆ Bump black

* 👷 Lint on CI

* ⬆ Bump flake8-black

* 🔧 Keep excluding migrations

* ⬆ Bump flake8

* 🔧 Remove black and flake8 from tox config

* ⬆ Update pre-commit versions

* Upgrade syntax to python 3.7+

* Format with pre-commit

dedent docs/schema.py to allow formatting

* Fix tests on python 3.7
2022-10-19 17:10:30 +03:00
Jarkko Piiroinen
e1a7d19833
Convert DecimalField to Decimal instead of Float in DRF and form converters (#1277)
* Convert serializer DecimalField to Decimal

* Convert form DecimalField to Decimal
2022-01-18 17:03:08 +03:00
Ülgen Sarıkavak
dd0d6ef28f
Python 3 (#904)
* Remove Python 2 support

* Upgrade Python & Django versions

* Remove unsupported Django versions
* Remove unsupported Python versions
* Add Python 3.8

* Drop support for django-filter < 2

* Update LoginRequiredMixin doc link

* Remove redundant import

* Resolve RemovedInDjango40Warning warnings

* gql/graphene-django/graphene_django/tests/test_converter.py:175:
RemovedInDjango40Warning: django.utils.translation.ugettext_lazy() is
deprecated in favor of django.utils.translation.gettext_lazy().

* graphene-django/graphene_django/utils/utils.py:28:
RemovedInDjango40Warning: force_text() is deprecated in favor of
force_str().

* No need to use unicode strings with Python3

* Remove singledispatch dependency

singledispatch is inluded with Python >= 3.4, no need for external
package.
2020-04-06 13:21:07 +01:00
Leeward Bound
83bc32bc9d
Adding support for disabling enum creation on SerializerMutation (#851) 2020-02-07 10:17:56 +00:00
Jason Kraus
a64ba65bef convert DRF ChoiceField to Enum (#537)
* convert DRF ChoiceField to Enum, also impacts FilePathField

* Pep8 fixes

* DRF multiple choices field converts to list of enum

* apply black formatting
2019-09-22 21:13:12 +01:00
Jonathan Kim
b7e4937775
Alias only_fields as fields and exclude_fields as exclude (#691)
* Create new fields and exclude options that are aliased to exclude_fields and only_fields

* Update docs

* Add some checking around fields and exclude definitions

* Add all fields option

* Update docs to include `__all__` option

* Actual order of fields is not stable

* Update docs/queries.rst

Co-Authored-By: Semyon Pupkov <semen.pupkov@gmail.com>

* Fix example code

* Format code

* Start raising PendingDeprecationWarnings for using only_fields and exclude_fields

* Update tests
2019-07-09 14:03:11 +01:00
Pablo Burgos
a2103c19f4 Fix error of multiple inputs with the same type. When using same serializer. (#530) 2019-07-09 09:14:04 +01:00
Syrus Akbary
54ef52e1c6 Reformatted files using black 2018-07-19 16:52:24 -07:00
mbarrientos
3793ce17c0 Add support for ListSerializer fields in SerializerMutation 2018-02-13 12:12:50 +01:00
=
1352d4e02b Fix func names 2017-12-18 12:33:42 -05:00
=
62c0694901 models.DateField corresponds to graphene Date Scalar 2017-12-05 15:04:29 -05:00
Syrus Akbary
2a73e5e479 Fixed flake 2017-09-01 00:52:57 -07:00
Andy Clayton
cc58b91e43 fix SerializerMutation regression for 2.x
72529b7 seems to break SerializerMutation by commenting out support for
input fields. As a result input only ever had a clientMutationId field.
2017-08-31 12:21:50 -05:00
Syrus Akbary
72529b70bb Fixed all tests and flake issues 2017-07-24 23:42:40 -07:00
Jacob Foster
ee23638378 Add converters for datetime fields 2017-07-11 13:35:12 -05:00
Jacob Foster
302ea0d3cf Account for nested ModelSerializers 2017-07-11 13:29:30 -05:00
Patrick Arminio
1a04d608ed Add support for MultipleChoiceField 2017-06-26 14:32:57 +01:00
Patrick Arminio
510ee9383e Add support for JSONField 2017-06-26 14:28:03 +01:00
Patrick Arminio
68f6281ec8 Add support for dict field 2017-06-26 14:19:55 +01:00
Patrick Arminio
f747102e35 Add support for rest framework List Field 2017-06-26 12:14:04 +01:00
Patrick Arminio
d10895d9ce Refactor converter 2017-06-26 11:36:48 +01:00
Patrick Arminio
14bc1cdb92 Add SerializerMutation base class 2017-06-26 09:19:49 +01:00
Patrick Arminio
2fd3cb032c Fix import on python 2 2017-06-26 09:19:49 +01:00
Patrick Arminio
fb2af7067f Initial implementation of serializer field converter 2017-06-26 09:19:49 +01:00