Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#8744 closed (duplicate)

__init__() got an unexpected keyword argument 'min_value'

Reported by: bryanveloso 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:

Description

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.

Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
  77.                     request.path_info)
File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in resolve
  178.             for pattern in self.urlconf_module.urlpatterns:
File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in _get_urlconf_module
  197.             self._urlconf_module = __import__(self.urlconf_name, {}, {}, [''])
File "/var/www/projectrenova/../projectrenova/urls.py" in <module>
  11. admin.autodiscover()
File "/usr/lib/python2.5/site-packages/django/contrib/admin/__init__.py" in autodiscover
  40.         __import__("%s.admin" % app)
File "/var/www/projectrenova/applications/blog/admin.py" in <module>
  19. admin.site.register(Entry, EntryAdmin)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in register
  91.             validate(admin_class, model)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/validation.py" in validate
  25.     validate_base(cls, model)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/validation.py" 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/validation.py" in check_formfield
  261.         fields = fields_for_model(model)
File "/usr/lib/python2.5/site-packages/django/forms/models.py" in fields_for_model
  145.         formfield = formfield_callback(f)
File "/usr/lib/python2.5/site-packages/django/forms/models.py" 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/__init__.py" in formfield
  760.         return super(PositiveSmallIntegerField, self).formfield(**defaults)
File "/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py" in formfield
  678.         return super(IntegerField, self).formfield(**defaults)
File "/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py" in formfield
  318.         return form_class(**defaults)
File "/usr/lib/python2.5/site-packages/django/forms/fields.py" in __init__
  666.         super(TypedChoiceField, self).__init__(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/forms/fields.py" 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 carljm 6 years ago.
temporary fix for this error

Download all attachments as: .zip

Change History (10)

comment:1 Changed 6 years ago by Uninen

  • 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 6 years ago by Uninen

  • Keywords admin, TypeError added

comment:3 Changed 6 years ago by Uninen

  • Cc ville@… added

comment:4 Changed 6 years ago by ubernostrum

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

comment:5 Changed 6 years ago by Uninen

  • Keywords TypeError, 1.0-blocker added; TypeError removed
  • Triage Stage changed from Unreviewed to Accepted

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

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

comment:6 Changed 6 years ago by carljm

  • Cc carl@… added

comment:7 Changed 6 years ago by carljm

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 6 years ago by carljm

temporary fix for this error

comment:8 Changed 6 years ago by ubernostrum

  • Resolution set to duplicate
  • Status changed from new to closed

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 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.