Django

Code

Ticket #8744 (closed: duplicate)

Opened 2 years ago

Last modified 2 years ago

__init__() got an unexpected keyword argument 'min_value'

Reported by: bryanveloso Assigned to: jacob
Milestone: 1.0 Component: Forms
Version: SVN Keywords: admin, TypeError, 1.0-blocker
Cc: ville@unessa.net, carl@dirtcircle.com Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

8744_r8786_temporary_fix.diff (0.5 kB) - added by carljm on 09/01/08 04:07:49.
temporary fix for this error

Change History

09/01/08 02:31:30 changed by Uninen

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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

09/01/08 02:32:27 changed by Uninen

  • keywords set to admin, TypeError.

09/01/08 02:32:50 changed by Uninen

  • cc set to ville@unessa.net.

09/01/08 02:34:56 changed by ubernostrum

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

09/01/08 02:40:08 changed by Uninen

  • keywords changed from admin, TypeError to admin, TypeError, 1.0-blocker.
  • 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?)

09/01/08 03:55:25 changed by carljm

  • cc changed from ville@unessa.net to ville@unessa.net, carl@dirtcircle.com.

09/01/08 04:05:13 changed 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.)

09/01/08 04:07:49 changed by carljm

  • attachment 8744_r8786_temporary_fix.diff added.

temporary fix for this error

09/01/08 04:17:24 changed by ubernostrum

  • status changed from new to closed.
  • resolution set to duplicate.

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.


Add/Change #8744 (__init__() got an unexpected keyword argument 'min_value')




Change Properties
Action