Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#8744 closed (duplicate)

__init__() got an unexpected keyword argument 'min_value'

Reported by: Bryan Veloso Owned by: Jacob
Component: Forms Version: master
Severity: Keywords: admin, TypeError, 1.0-blocker
Cc: ville@…, carl@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I updated to [8373] and got this error. It went away when I commented out admin.autodiscover, but I'm sure it's not just that that's affected. Brian Rosner mentioned that it might have to do with some changes that Jacob had made earlier today. Here's my traceback.

File "/usr/lib/python2.5/site-packages/django/core/handlers/" in get_response
  77.                     request.path_info)
File "/usr/lib/python2.5/site-packages/django/core/" in resolve
  178.             for pattern in self.urlconf_module.urlpatterns:
File "/usr/lib/python2.5/site-packages/django/core/" in _get_urlconf_module
  197.             self._urlconf_module = __import__(self.urlconf_name, {}, {}, [''])
File "/var/www/projectrenova/../projectrenova/" in <module>
  11. admin.autodiscover()
File "/usr/lib/python2.5/site-packages/django/contrib/admin/" in autodiscover
  40.         __import__("%s.admin" % app)
File "/var/www/projectrenova/applications/blog/" in <module>
  19., EntryAdmin)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/" in register
  91.             validate(admin_class, model)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/" in validate
  25.     validate_base(cls, model)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/" in validate_base
  180.             check_formfield(cls, model, opts, "fieldsets[%d][1]['fields']" % idx, field)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/" in check_formfield
  261.         fields = fields_for_model(model)
File "/usr/lib/python2.5/site-packages/django/forms/" in fields_for_model
  145.         formfield = formfield_callback(f)
File "/usr/lib/python2.5/site-packages/django/forms/" in <lambda>
  124. def fields_for_model(model, fields=None, exclude=None, formfield_callback=lambda f: f.formfield()):
File "/usr/lib/python2.5/site-packages/django/db/models/fields/" in formfield
  760.         return super(PositiveSmallIntegerField, self).formfield(**defaults)
File "/usr/lib/python2.5/site-packages/django/db/models/fields/" in formfield
  678.         return super(IntegerField, self).formfield(**defaults)
File "/usr/lib/python2.5/site-packages/django/db/models/fields/" in formfield
  318.         return form_class(**defaults)
File "/usr/lib/python2.5/site-packages/django/forms/" in __init__
  666.         super(TypedChoiceField, self).__init__(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/forms/" in __init__
  621.                                           help_text, *args, **kwargs)

Exception Type: TypeError at /
Exception Value: __init__() got an unexpected keyword argument 'min_value'

Attachments (1)

8744_r8786_temporary_fix.diff (523 bytes) - added by Carl Meyer 8 years ago.
temporary fix for this error

Download all attachments as: .zip

Change History (10)

comment:1 Changed 8 years ago by Ville Säävuori

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

I have this same problem when trying to edit a model with PositiveIntegerField in admin. Using r8777.

comment:2 Changed 8 years ago by Ville Säävuori

Keywords: admin TypeError added

comment:3 Changed 8 years ago by Ville Säävuori

Cc: ville@… added

comment:4 Changed 8 years ago by James Bennett

This feels like a consequence of what's happening over in #6967.

comment:5 Changed 8 years ago by Ville Säävuori

Keywords: 1.0-blocker added
Triage Stage: UnreviewedAccepted

FWIW, some of the fields in my app do use choices with PositiveIntegerFields.

(And this is a 1.0-blocker, right?)

comment:6 Changed 8 years ago by Carl Meyer

Cc: carl@… added

comment:7 Changed 8 years ago by Carl Meyer

I ran into this error (also on a PositiveIntegerField with choices). I get the error on r8772, not on r8771; definitely the same deal as #6967. For anyone getting this error and not wanting to roll back to r8771, a temporary fix is in the attached patch. (As mattmcc mentions here, this is only a stopgap, not a real solution.)

Changed 8 years ago by Carl Meyer

temporary fix for this error

comment:8 Changed 8 years ago by James Bennett

Resolution: duplicate
Status: newclosed

Given that it's now (per comment above) been established that this is a consequence of #6967, which has been reopened, I'm closing this as a duplicate.

comment:9 Changed 5 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top