Gustavo Picon is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

tabo / django-treebeard

Efficient tree implementations for Django 1.0+ :: https://tabo.pe/projects/django-treebeard/

Clone this repository (size: 602.0 KB): HTTPS / SSH
hg clone https://bitbucket.org/tabo/django-treebeard
hg clone ssh://hg@bitbucket.org/tabo/django-treebeard

Issues

#10 Object won't save in contrib.admin (Django Version: 1.2 alpha 1)

Reported by Mikhail Lukyanchenko (last edited )

models.py:

from django.db import models
from treebeard import mp_tree

class Page(mp_tree.MP_Node):
    title = models.CharField(max_length=200)

admin.py:

from django.contrib import admin
from pages import models
from treebeard.admin import TreeAdmin

admin.site.register(models.Page, TreeAdmin)

Whenever I try to create new object via contrib.admin, I get following exception:

Environment:

Request Method: POST
Request URL: http://localhost:8000/admin/pages/page/add/
Django Version: 1.2 alpha 1
Python Version: 2.5.4
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'treebeard',
 'pages']
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.cache.FetchFromCacheMiddleware',
 'django.middleware.http.ConditionalGetMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File ".../lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
  99.                     response = callback(request, *callback_args, **callback_kwargs)
File ".../lib/python2.5/site-packages/django/contrib/admin/options.py" in wrapper
  237.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File ".../lib/python2.5/site-packages/django/utils/decorators.py" in __call__
  36.         return self.decorator(self.func)(*args, **kwargs)
File ".../lib/python2.5/site-packages/django/utils/decorators.py" in _wrapped_view
  86.                     response = view_func(request, *args, **kwargs)
File ".../lib/python2.5/site-packages/django/utils/decorators.py" in __call__
  36.         return self.decorator(self.func)(*args, **kwargs)
File ".../lib/python2.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  70.         response = view_func(request, *args, **kwargs)
File ".../lib/python2.5/site-packages/django/contrib/admin/sites.py" in inner
  187.             return view(request, *args, **kwargs)
File ".../lib/python2.5/site-packages/django/utils/decorators.py" in _wrapped_view
  86.                     response = view_func(request, *args, **kwargs)
File ".../lib/python2.5/site-packages/django/db/transaction.py" in _commit_on_success
  295.                     res = func(*args, **kw)
File ".../lib/python2.5/site-packages/django/contrib/admin/options.py" in add_view
  760.             if form.is_valid():
File ".../lib/python2.5/site-packages/django/forms/forms.py" in is_valid
  120.         return self.is_bound and not bool(self.errors)
File ".../lib/python2.5/site-packages/django/forms/forms.py" in _get_errors
  111.             self.full_clean()
File ".../lib/python2.5/site-packages/django/forms/forms.py" in full_clean
  286.             self.cleaned_data = self.clean()
File ".../lib/python2.5/site-packages/django/forms/models.py" in clean
  270.                 raise UnresolvableValidationError(e.message_dict)

Exception Type: UnresolvableValidationError at /admin/pages/page/add/
Exception Value: {'path': [u'This field cannot be blank.'], 'depth': [u'This field cannot be null.']}

Status: invalid Responsible: Gustavo Picon Type: bug Priority: major
Milestone: none Component: none Version: none

Attachments

No attachments added for this issue yet.

Comments and changes

  1. #1 Mikhail Korobov

    written

    There are bugs in django 1.2 alpha1's introduced model validation. A part of them was fixed in django trunk. Can you please check if the problem exists with latest django SVN checkout?

  2. #2 Mikhail Lukyanchenko

    written

    • Changed status from new to invalid.

    As for r12276 this problem does not exist.

    Thanks.

Add comment / attachment

Show/hide preview

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?