Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'JSONSchemaField' object has no attribute 'is_hidden' #2

Open
srugano opened this issue Jan 27, 2020 · 0 comments
Open

'JSONSchemaField' object has no attribute 'is_hidden' #2

srugano opened this issue Jan 27, 2020 · 0 comments

Comments

@srugano
Copy link

srugano commented Jan 27, 2020

Implementing the example with a JSONField :

class Category(models.Model):
    field = JSONField(default=dict)

    class Meta:
        ordering = ("-pk",)

    def __str__(self):
        return self.id

and the corresponding implementation :


schema = {
    "title": "Config Schema",
    "description": "My configutation schema",
    "type": "object",
    "properties": {
        "field": {
            "description": "List of field size",
            "type": "array"
        }
    },
    "required": [
        "field",
    ],
}

@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
    formfield_overrides = {
        JSONField: {'widget': JSONSchemaWidget(schema)}
    }

But I get some errors with :

Django Version: 2.2.9
Exception Type: AttributeError
Exception Value: 'JSONSchemaField' object has no attribute 'is_hidden'
Exception Location: /Users/user/.virtualenvs/beaver/lib/python3.5/site-packages/django/forms/boundfield.py in is_hidden, line 183
Python Executable: /Users/user/.virtualenvs/beaver/bin/python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant