A.
First I login to the admin site to add a record of Class A. Then add a
record of Class B by choosing the only record of Class A as FK. Error
occurs after clicking "save" button. Is this a bug? or my setting is
wrong?
Thank you.
####################################################
OS : CentOS 5 (x86)
Database : Postgresql 8.2
####################################################
TypeError at /admin/inventory/room/add/
coercing to Unicode: need string or buffer, long found
Request Method: POST
Request URL: http://localhost:8888/admin/inventory/room/add/
Django Version: 1.2.1
Exception Type: TypeError
Exception Value:
coercing to Unicode: need string or buffer, long found
Exception Location: /usr/lib/python2.4/site-packages/django/utils/
encoding.py in force_unicode, line 66
Python Executable: /usr/bin/python
Python Version: 2.4.3
Python Path: ['/data/home/karl-lam/public_html/abc', '/usr/lib/
python2.4/site-packages/setuptools-0.6c11-py2.4.egg', '/usr/lib/
python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2',
'/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/
lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/
Numeric', '/usr/lib/python2.4/site-packages/PIL', '/usr/lib/python2.4/
site-packages/gtk-2.0']
Server time: Sun, 30 May 2010 17:05:45 +0800
Environment:
Request Method: POST
Request URL: http://localhost:8888/admin/inventory/room/add/
Django Version: 1.2.1
Python Version: 2.4.3
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'abc.polls',
'abc.inventory']
Installed Middleware:
('django.middleware.gzip.GZipMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.transaction.TransactionMiddleware')
Traceback:
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py"
in get_response
100. response = callback(request,
*callback_args, **callback_kwargs)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/
options.py" in wrapper
239. return self.admin_site.admin_view(view)(*args,
**kwargs)
File "/usr/lib/python2.4/site-packages/django/utils/decorators.py" in
_wrapped_view
76. response = view_func(request, *args,
**kwargs)
File "/usr/lib/python2.4/site-packages/django/views/decorators/
cache.py" in _wrapped_view_func
69. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/sites.py"
in inner
190. return view(request, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/utils/decorators.py" in
_wrapper
21. return decorator(bound_func)(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/utils/decorators.py" in
_wrapped_view
76. response = view_func(request, *args,
**kwargs)
File "/usr/lib/python2.4/site-packages/django/utils/decorators.py" in
bound_func
17. return func(self, *args2, **kwargs2)
File "/usr/lib/python2.4/site-packages/django/db/transaction.py" in
_commit_on_success
299. res = func(*args, **kw)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/
options.py" in add_view
800. self.log_addition(request, new_object)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/
options.py" in log_addition
428. object_repr = force_unicode(object),
File "/usr/lib/python2.4/site-packages/django/utils/encoding.py" in
force_unicode
66. s = unicode(s)
Exception Type: TypeError at /admin/inventory/room/add/
Exception Value: coercing to Unicode: need string or buffer, long
found
#####################################################################
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment