Comments (4)
I managed to fix this by changing graphene_django_cud\converter.py
:
if from_registry:
if hasattr(from_registry, 'kwargs'):
from_registry.kwargs['description'] = field.help_text
from_registry.kwargs['required'] = is_required(field, required)
else:
from_registry.description = field.help_text
from_registry.required = is_required(field, required)
return from_registry
from graphene-django-cud.
python version 3.10.3 django version 4.0.3 graphene-django from main branch latest commit by date of posting(f6ec0689c18929344c79ae363d2e3d5628fa4a2d) graphene_django_cud version 0.10.0
I was trying to create a DjangoCreateMutation(actually it fails for any kind of mutation) with this model
from django.db import models from django.contrib.auth import get_user_model User = get_user_model() class Staff(models.Model): class StaffStatus(models.TextChoices): WORKING = 'working', 'Working' SUSPENDED = 'suspended', 'Suspended' FIRED = 'fired', 'Fired' first_name = models.CharField(max_length=64) middle_name = models.CharField(max_length=64) last_name = models.CharField(max_length=64) phone = models.CharField(max_length=32) email = models.CharField(max_length=256) position = models.CharField(max_length=64) address = models.CharField(max_length=512) status = models.CharField(max_length=16, choices=StaffStatus.choices, default=StaffStatus.WORKING) is_admin = models.BooleanField(default=False) user = models.OneToOneField(User, on_delete=models.SET_NULL, null=True, related_name='staff') def __str__(self): return f'{self.last_name} {self.first_name}({self.id})'I suppose most of the fields can be skipped except the one with choices which was created via class _(models.TextChoices) or its analogues in it.
And when I tried to run app it fails with message
File "lib\site-packages\graphene_django_cud\converter.py", line 116, in convert_django_field_with_choices from_registry.kwargs['description'] = field.help_text AttributeError: 'BlankValueField' object has no attribute 'kwargs'. Did you mean: 'args'?
you have this issue because you have graphene-django==3.0.0b7
. if you downgrade it to graphene-django==2.15.0
you will not have this issue
from graphene-django-cud.
I also have the same problemi with following libs:
Python 3.10.6
Django 4.2.2
graphene 3.2.2
graphene-django 3.0.0
graphene-django-cud 0.10.0
from graphene-django-cud.
Closed with version 0.11.0.
from graphene-django-cud.
Related Issues (20)
- How to query errors from the mutation result? HOT 1
- This package ROCKS!!! HOT 1
- many_to_one_extras not correctly saving reverse relations
- Cryptic error message on `unique_together` error when using DjangoPatchMutation
- Mutations and DateField issue in graphene-django-cud code
- Improve documentation
- Incompatibility with latest graphene-django v3.1.2, due to import of `compat.JSONField`
- Release after graphene-django's compat.JSONField removal HOT 1
- Missing documentation in "Nested fields" about excluding fields
- many_to_many_extras with through table referencing the same model HOT 2
- Respect Django's own validation mechanism HOT 7
- Some proposals for improvement HOT 1
- Make it possible to configure calling `obj.full_clean` on all mutations as a part of natural object validation HOT 3
- [Batch mutations]: Create a hook for altering a single object's input data
- Add support for optional foreign keys with foreign_key_extras
- Add get_or_create support for foreign_key_extras
- Is there a way to use nested "many extras" to create/update/remove at once, without separate fields?
- Getting error 'super' object has no attribute 'items' when performing a create mutation on model with a ForeignKey on itself
- Nested one-to-one fields
- End of life HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphene-django-cud.