On Wed, 2007-06-13 at 21:03 +0000, [EMAIL PROTECTED] wrote:
> I have a custom context processor that is in my settings file, so it
> is being called on each request.  When making any request, I receive
> the following error.
> 
> Traceback (most recent call last):
> File "c:\Python24\lib\site-packages\django\core\handlers\base.py" in
> get_response
>   77. response = callback(request, *callback_args, **callback_kwargs)
> File "c:\Python24\lib\site-packages\django\contrib\admin\views
> \decorators.py" in _checklogin
>   65. return _display_login_form(request, message)
> File "c:\Python24\lib\site-packages\django\contrib\admin\views
> \decorators.py" in _display_login_form
>   28. }, context_instance=template.RequestContext(request))
> File "c:\Python24\lib\site-packages\django\template\context.py" in
> __init__
>   100. self.update(processor(request))
> File "C:\djangosites\AGD\..\AGD\context_processors.py" in member
>   5. member = Member.objects.get(user=request.user)
> File "c:\Python24\lib\site-packages\django\db\models\manager.py" in
> get
>   73. return self.get_query_set().get(*args, **kwargs)
> File "c:\Python24\lib\site-packages\django\db\models\query.py" in get
>   250. obj_list = list(clone)
> File "c:\Python24\lib\site-packages\django\db\models\query.py" in
> __iter__
>   108. return iter(self._get_data())
> File "c:\Python24\lib\site-packages\django\db\models\query.py" in
> _get_data
>   470. self._result_cache = list(self.iterator())
> File "c:\Python24\lib\site-packages\django\db\models\query.py" in
> iterator
>   183. cursor.execute("SELECT " + (self._distinct and "DISTINCT " or
> "") + ",".join(select) + sql, params)
> File "c:\Python24\lib\site-packages\django\db\backends\util.py" in
> execute
>   24. self.db.queries.append({
> 
>   TypeError at /admin/
>   __str__ returned non-string (type instance)
> 
> All of my __str__ methods are returning strings according to the
> model.

There might be other __str__ methods being called apart from the one on
Member; it's hard to tell. If you can't work this out from looking at
the local variables in the debug page's traceback, try putting a
try...except block around that line in Django's source and printing out
the types of everything involved there. Basically, you have to catch it
in the act and work backwards.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to