Opened 10 years ago

Closed 10 years ago

#7449 closed (worksforme)

edit_inline with IntegerField cause error: 'int' object is unsubscriptable

Reported by: rudyryk <alexey.rudy@…> Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: alexey.rudy@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I'm using revision 7631, latest for now.

Error occurs in both cases: when creating and editing new object. Models are taken from tutorial. See traceback and code below.

File "C:\Python25\Lib\site-packages\django\core\handlers\" in get_response
  82.                 response = callback(request, *callback_args, **callback_kwargs)
File "C:\Python25\Lib\site-packages\django\contrib\admin\views\" in _checklogin
  62.             return view_func(request, *args, **kwargs)
File "C:\Python25\lib\site-packages\django\views\decorators\" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "C:\Python25\Lib\site-packages\django\contrib\admin\views\" in add_stage
  264.             new_object =
File "C:\Python25\Lib\site-packages\django\db\models\" in save
  173.                         if f.core and not isinstance(f, FileField) and f.get_manipulator_new_data(rel_new_data, rel=True) in (None, ''):
File "C:\Python25\lib\site-packages\django\db\models\fields\" in get_manipulator_new_data
  363.             return new_data.get(, [self.get_default()])[0]

Exception Type: TypeError at /admin/my_hello/poll/add/
Exception Value: 'int' object is unsubscriptable
from django.db import models
import datetime

# Create your models here.

class Poll(models.Model):
        question = models.CharField(max_length=200)
        pub_date = models.DateTimeField('date published')
        class Admin:
        def __unicode__(self):
                return self.question

class Choice(models.Model):
        poll = models.ForeignKey(Poll, edit_inline=models.TABULAR, min_num_in_admin=3)
        choice = models.CharField(max_length=200, core=True)
        votes = models.IntegerField(core=True, default=0)
        class Admin:
        def __unicode__(self):
                return self.choice

Change History (1)

comment:1 Changed 10 years ago by Ramiro Morales

Resolution: worksforme
Status: newclosed

I can't reproduce this, also using r7631 with the sqlite3 backend and using exactly the same file. Please post this report to the dango-users list or the #django IRC channel with additional details.

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