obsicn / eshop

The sample project based on Django oscar ecommerce framework.
0 stars 0 forks source link

创建新的product时失败 #7

Open obsicn opened 7 years ago

obsicn commented 7 years ago

Environment:

Request Method: GET Request URL: http://127.0.0.1:8000/dashboard/catalogue/products/create/shi-wu/

Django Version: 1.11 Python Version: 3.6.1 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'django.contrib.flatpages', 'widget_tweaks', 'oscar', 'oscar.apps.analytics', 'oscar.apps.checkout', 'oscar.apps.address', 'oscar.apps.shipping', 'oscar.apps.catalogue', 'oscar.apps.catalogue.reviews', 'oscar.apps.partner', 'oscar.apps.basket', 'oscar.apps.payment', 'oscar.apps.offer', 'oscar.apps.order', 'oscar.apps.customer', 'oscar.apps.promotions', 'oscar.apps.search', 'oscar.apps.voucher', 'oscar.apps.wishlists', 'oscar.apps.dashboard', 'oscar.apps.dashboard.reports', 'oscar.apps.dashboard.users', 'oscar.apps.dashboard.orders', 'oscar.apps.dashboard.promotions', 'oscar.apps.dashboard.catalogue', 'oscar.apps.dashboard.offers', 'oscar.apps.dashboard.partners', 'oscar.apps.dashboard.pages', 'oscar.apps.dashboard.ranges', 'oscar.apps.dashboard.reviews', 'oscar.apps.dashboard.vouchers', 'oscar.apps.dashboard.communications', 'oscar.apps.dashboard.shipping', 'haystack', 'treebeard', 'sorl.thumbnail', 'django_tables2'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'oscar.apps.basket.middleware.BasketMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware']

Template error: In template /Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/oscar/templates/oscar/dashboard/partials/product_images.html, error at line 6 build_attrs() got an unexpected keyword argument 'type' 1 :

  • 2 : {% for field in form %} 3 : {% if field.is_hidden %} 4 : {{ field }} 5 : {% elif "original" in field.id_for_label %} 6 :
    {{ field }}
    7 : {% for error in field.errors %} 8 :
      9 :
    • {{ error }}
    • 10 :
    11 : {% endfor %} 12 : {% else %} 13 : {{ field.label_tag }} 14 : {{ field }} 15 : {% for error in field.errors %} 16 :

      Traceback:

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner

      1. response = get_response(request)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response

      1. response = self.process_exception_by_middleware(e, request)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response

      1. response = response.render()

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/response.py" in render

      1. self.content = self.rendered_content

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/response.py" in rendered_content

      1. content = template.render(context, self._request)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/backends/django.py" in render

      1. return self.template.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. return self._render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in _render

      1. return self.nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render

      1. return compiled_parent._render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in _render

      1. return self.nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render

      1. return compiled_parent._render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in _render

      1. return self.nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render

      1. return compiled_parent._render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in _render

      1. return self.nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render

      1. result = block.nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render

      1. result = block.nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render

      1. result = block.nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render

      1. result = block.nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render

      1. result = block.nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/defaulttags.py" in render

      1. nodelist.append(node.render_annotated(context))

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/loader_tags.py" in render

      1. return template.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. return self._render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in _render

      1. return self.nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/defaulttags.py" in render

      1. nodelist.append(node.render_annotated(context))

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/defaulttags.py" in render

      1. return nodelist.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. bit = node.render_annotated(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_annotated

      1. return self.render(context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render

      1. return render_value_in_context(output, context)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/template/base.py" in render_value_in_context

      1. value = force_text(value)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/utils/encoding.py" in force_text

      1. s = six.text_type(s)

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/utils/html.py" in

      1. klass.str = lambda self: mark_safe(klass_str(self))

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/forms/boundfield.py" in str

      1. return self.as_widget()

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/django/forms/boundfield.py" in as_widget

      1. **kwargs

      File "/Users/myang/workspaces/oscar_prj/env/lib/python3.6/site-packages/oscar/forms/widgets.py" in render

      1. final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)

      Exception Type: TypeError at /dashboard/catalogue/products/create/shi-wu/ Exception Value: build_attrs() got an unexpected keyword argument 'type'