我最近也改变了我的模型和我的sqlite3数据库 .

当我运行服务器并转到我的 admin/project/model 页面时 . 我收到一个错误:

基数为10的int()的无效文字:'updated' .

更新是我模型中的一个字段 .

models.py:

@reversion.register
class Block(models.Model):      
    class Meta:
        verbose_name_plural = "Request Blocks"
    inventory = models.ForeignKey(Inventory, null=True) #limit_choices_to={'inventory_name': True})
    added = models.DateTimeField(auto_now_add=True, null=True)
    updated = models.DateTimeField(auto_now=True, null=True)
    name = models.CharField(max_length=50, null=True) #unique=True)
    status = models.CharField(max_length=32, default='pending')
    derivatives = models.CharField(max_length=256, null=True)  
    subsystems = models.CharField(max_length=128, null=True)
    ip = models.CharField(max_length=128, null=True)
    owners = models.CharField(max_length=100, null=True)

admin.py:

class BlockAdmin(reversion.VersionAdmin, admin.ModelAdmin):
    action_form = UpdateActionForm
    list_display = ['name', 'status', 'inventory', 'derivatives', 'added', 'updated'] #'block_date']
    list_filter = ['inventory', 'status', 'derivatives', ]
    search_fields = ['name']
    #list_per_page = 200
    ordering = ['name']
    actions = ['make_finalized', 'make_pending', 'move_to_inventory', 'block_current_date', 'export_csv', 'export_xls', 'export_xlsx']

Error:

Environment:


Request Method: GET
Request URL: http://localhost:8000/admin/inventory/block/

Django Version: 1.8.2
Python Version: 2.7.9


Template error:
In template /usr/lib/python2.7/site-packages/Django-1.8.2-    py2.7.egg/django/contrib/admin/templates/admin/change_list.html, error at line 91
invalid literal for int() with base 10: 'updated'

{% endif %}
 {% endblock %}

      <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %}
      {% if cl.formset %}
        <div>{{ cl.formset.management_form }}</div>
      {% endif %}

      {% block result_list %}
          {% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %}


      LINE 91{% result_list cl %}



          {% if action_form and actions_on_bottom and cl.show_admin_actions %}{% admin_actions %}{% endif %}
      {% endblock %}
      {% block pagination %}{% pagination cl %}{% endblock %}
      </form>
    </div>
  </div>
{% endblock %}


Exception Type: ValueError at /admin/inventory/block/
Exception Value: invalid literal for int() with base 10: 'updated'

Traceback:

get_response中的文件“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/core/handlers/base.py”.response = response.render()File渲染中的“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/template/response.py”.self.content = self.rendered_content文件“/ usr / lib / python2.7 / site-packages / Django-1.8.2-py2.7.egg / django / template / response.py“in rendered_content 135. content = template.render(context,self._request)File”/ usr /lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/template/backends/django.py“在渲染74中 . 返回self.template.render(context)文件”/ usr /lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/template/base.py“in render 209. return self._render(context)File”/ usr / lib / python2 .7 / site-packages / Django-1.8.2-py2.7.egg / django / template / base.py“in _render 201. return self.nodelist.render(context)File”/usr/lib/python2.7 /site-packages/Django-1.8.2-py2.7.egg/django/template/base.py“in render 903. bit = self.render_node(no de,context)在render_node 79中输入文件“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/template/debug.py” . 返回node.render(context)在渲染135中输入文件“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/template/loader_tags.py” . 返回compiled_parent._render(context)文件“/ usr /lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/template/base.py“在_render 201中 . 返回self.nodelist.render(context)文件”/ usr / lib /python2.7/site-packages/Django-1.8.2-py2.7.egg/django/template/base.py“in render 903. bit = self.render_node(node,context)File”/ usr / lib / python2.7 / site-packages / Django-1.8.2-py2.7.egg / django / template / debug.py“在render_node 79中 . 返回node.render(context)文件”/usr/lib/python2.7/ site-packages / Django-1.8.2-py2.7.egg / django / template / loader_tags.py“in render 135. return compiled_parent._render(context)File”/usr/lib/python2.7/site-packages/ _render 201中的Django-1.8.2-py2.7.egg / django / template / base.py“ . 返回self.nodelist.render(context)渲染903中的文件“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/template/base.py”.bit = self.render_node(node,context)文件“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/template/debug.py”在render_node 79中 . 返回node.render(context)文件“/ usr / lib / python2.7 / site-packages / Django-1.8.2-py2.7.egg / django / template / loader_tags.py“in render 135. return compiled_parent._render(context)File”/ usr / lib / python2 . 7 / site-packages / Django-1.8.2-py2.7.egg / django / template / base.py“in _render 201. return self.nodelist.render(context)File”/usr/lib/python2.7/ site-packages / Django-1.8.2-py2.7.egg / django / template / base.py“in render 903. bit = self.render_node(node,context)File”/usr/lib/python2.7/site -packages / Django-1.8.2-py2.7.egg / django / template / debug.py“in render_node 79. return node.render(context)File”/usr/lib/python2.7/site-packages/Django -1.8.2-py2.7.egg / django / template / loader_tags.py“in render 65. result = block.nodelist.render(context)File”/ usr / l ib / python2.7 / site-packages / Django-1.8.2-py2.7.egg / django / template / base.py“in render 903. bit = self.render_node(node,context)File”/ usr / lib /flathon2.7/site-packages/Django-1.8.2-py2.7.egg/django/template/debug.py“在render_node 79中 . 返回node.render(context)文件”/usr/lib/python2.7 /site-packages/Django-1.8.2-py2.7.egg/django/template/loader_tags.py“in render 65. result = block.nodelist.render(context)File”/usr/lib/python2.7/ site-packages / Django-1.8.2-py2.7.egg / django / template / base.py“in render 903. bit = self.render_node(node,context)File”/usr/lib/python2.7/site -packages / Django-1.8.2-py2.7.egg / django / template / debug.py“in render_node 79. return node.render(context)File”/usr/lib/python2.7/site-packages/Django -1.8.2-py2.7.egg / django / template / base.py“in render 1271. _dict = func(* resolved_args,** resolved_kwargs)File”/usr/lib/python2.7/site-packages/Django结果_list 320中的-1.8.2-py2.7.egg / django / contrib / admin / templatetags / admin_list.py“'结果':list(results(cl))} Fi结果296中的“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/contrib/admin/templatetags/admin_list.py” . 产品ResultList(None,items_for_result( cl,res,None))在init 287中输入文件“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/contrib/admin/templatetags/admin_list.py” . super(ResultList,self).init(* items)文件“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/contrib/admin/templatetags/admin_list.py “in items_for_result 199. f,attr,value = lookup_field(field_name,result,cl.model_admin)File”/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/ contrib / admin / utils.py“在lookup_field 288.值= getattr(obj,name)get 598中的文件“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/db/models/fields/related.py” . qs = qs.filter(** params)文件“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/db/models/query.py”在过滤器679中返回self._filter_or_exclude(False,* args,** kwargs)文件“/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django/db/models/query . py“in _filter_or_exclude 697. clone.query.add_q(Q(* args,** kwargs))file”/usr/lib/python2.7/site-packages/Django-1.8.2-py2.7.egg/django /db/models/sql/query.py“在add_q 1304.子句中,require_inner = self._add_q(where_part,self.used_aliases)文件”/usr/lib/python2.7/site-packages/Django-1.8.2- py2.7.egg / django / db / models / sql / query.py“in _add_q 1332. allow_joins = allow_joins,split_subq = split_subq,File”/usr/lib/python2.7/site-packages/Django-1.8.2 -bu2.7.egg / django / db / models / sql / query.py“在build_filter 1203中.condition = self.build_lookup(lookups,col,value)文件”/usr/lib/python2.7/site-pac kages / Django-1.8.2-py2.7.egg / django / db / models / sql / query.py“在build_lookup 1096中 . 返回final_lookup(lhs,rhs)文件”/usr/lib/python2.7/site- package / Django-1.8.2-py2.7.egg / django / db / models / lookups.py“在init 96中.self.rhs = self.get_prep_lookup()文件”/usr/lib/python2.7/site-在get_prep_lookup 134中的packages / Django-1.8.2-py2.7.egg / django / db / models / lookups.py“ . 返回self.lhs.output_field.get_prep_lookup(self.lookup_name,self.rhs)文件”/ usr / get_prep_lookup 727中的lib / python2.7 / site-packages / Django-1.8.2-py2.7.egg / django / db / models / fields / init.py“return self.get_prep_value(value)File”/ usr / get_prep_value 985中的lib / python2.7 / site-packages / Django-1.8.2-py2.7.egg / django / db / models / fields / init.py“return int(value)Exception Type:ValueError at / admin / inventory / block / Exception Value:基数为10的int()的文字无效:'updated'

有人可以帮忙解决这个错误吗?