Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.

Conversation

@YutaUra
Copy link

@YutaUra YutaUra commented Feb 9, 2020

Error Fix

TypeError at /admindjango_press/part/add/
__init__() got an unexpected keyword argument 'max_length'
# site-packages\codemirror\fields.py in __init__

class CodeMirrorFormField(forms.fields.Field):
    def __init__(self, *args, **kwargs):
        kwargs.update({'widget': CodeMirrorTextarea})
        super(CodeMirrorFormField, self).__init__(*args, **kwargs) # <- error
Variable Value
class <class 'codemirror.fields.CodeMirrorFormField'>
args ()
kwargs {'help_text': '', 'label': 'Codemirror', 'max_length': None, 'required': True, 'widget': <class 'codemirror.widgets.CodeMirrorTextarea'>}
self <codemirror.fields.CodeMirrorFormField object at 0x0000027113EF6EF0>

ref

# django.forms.fields.Field

class Field:
    # ...
    def __init__(self, *, required=True, widget=None, label=None, initial=None,
                 help_text='', error_messages=None, show_hidden_initial=False,
                 validators=(), localize=False, disabled=False, label_suffix=None):

# ...

class CharField(Field):
    def __init__(self, *, max_length=None, min_length=None, strip=True, empty_value='', **kwargs):

@lambdalisue
Copy link
Owner

I've added example project. How could I reproduce the error with that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants