django-jsonschema-form icon indicating copy to clipboard operation
django-jsonschema-form copied to clipboard

'JSONSchemaField' object has no attribute 'is_hidden'

Open srugano opened this issue 5 years ago • 0 comments

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

srugano avatar Jan 27 '20 19:01 srugano