Posted by mkowalski |
|
Environment:
Request Method: GET Request URL: http://www.gradethetrade.com/singleview/1/ Django Version: 1.0.2 final Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.humanize', 'django.contrib.flatpages', 'django.contrib.markup', 'djangoratings', 'messages', 'photologue', 'sphene.sphcomments', 'sphene.community', 'sphene.sphboard', 'sphene.sphwiki', 'grade.search', 'grade.usermanager', 'grade.search'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware', 'sphene.community.middleware.ThreadLocals', 'sphene.community.middleware.GroupMiddleware') Traceback: File "/var/lib/python-support/python2.5/django/core/handlers/base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File "/var/lib/python-support/python2.5/django/contrib/auth/decorators.py" in __call__ 67. return self.view_func(request, *args, **kwargs) Exception Type: TypeError at /singleview/1/ Exception Value: singleView() got an unexpected keyword argument 'group' Not sure which 'group' it's referring to. |
|
Posted by mkowalski |
|
And another one
TemplateSyntaxError at /singleview/1/ Caught an exception while rendering: 'str' object has no attribute '_meta' Original Traceback (most recent call last): File "/var/lib/python-support/python2.5/django/template/debug.py", line 71, in render_node result = node.render(context) File "/usr/lib/python2.5/site-packages/sphene/community/templatetagutils.py", line 14, in render self.callback(retriever, context) File "/usr/lib/python2.5/site-packages/sphene/sphcomments/templatetags/sphcomments_extras.py", line 20, in get_commentinfos obj) File "/usr/lib/python2.5/site-packages/sphene/sphcomments/models.py", line 21, in get_or_create_for_object model_type = ContentType.objects.get_for_model(model_instance) File "/var/lib/python-support/python2.5/django/contrib/contenttypes/models.py", line 17, in get_for_model opts = model._meta AttributeError: 'str' object has no attribute '_meta' Request Method: GET Request URL: http://www.gradethetrade.com/singleview/1/ Exception Type: TemplateSyntaxError Exception Value: Caught an exception while rendering: 'str' object has no attribute '_meta' Original Traceback (most recent call last): File "/var/lib/python-support/python2.5/django/template/debug.py", line 71, in render_node result = node.render(context) File "/usr/lib/python2.5/site-packages/sphene/community/templatetagutils.py", line 14, in render self.callback(retriever, context) File "/usr/lib/python2.5/site-packages/sphene/sphcomments/templatetags/sphcomments_extras.py", line 20, in get_commentinfos obj) File "/usr/lib/python2.5/site-packages/sphene/sphcomments/models.py", line 21, in get_or_create_for_object model_type = ContentType.objects.get_for_model(model_instance) File "/var/lib/python-support/python2.5/django/contrib/contenttypes/models.py", line 17, in get_for_model opts = model._meta AttributeError: 'str' object has no attribute '_meta' Exception Location: /var/lib/python-support/python2.5/django/template/debug.py in render_node, line 81 |
|
Posted by mkowalski |
|
Just to be a bit more clear, I have a class called UserProfile while the instance in use is called viewSingle. Putting that in both model fields (the include object_type) and _comments.html results in
Caught an exception while rendering: 'NoneType' object has no attribute 'id' |
|
Posted by Herbert Poul |
|
no idea what you mean with 'both model fields' .. but.. you have to use: viewSingle (the model instance) for the template tag sphcomments_load_infos
if a {% sphcomments_load_infos viewSingle %} leads to the error with the NoneType .. please make sure viewSingle is not None .. and paste me the full stacktrace.. Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by mkowalski |
|
{% with viewSingle as comment_object %}
{% include "usermanager/_comments.html" %} {% endwith %} and {% sphcomments_load_infos viewSingle %} and the view generating it @login_required def singleView(request, profile_id): try: viewSingle = UserProfile.objects.get(id = profile_id) except UserProfile.DoesNotExist: raise Http404 t = loader.get_template('singleview.html') c = Context({ #Need to put the Business name in the title 'title': 'Gradethetrade.com - Viewing', 'header': 'Viewing', 'contenthigh': 'Information', 'viewSingle': viewSingle, }) return HttpResponse(t.render(c)) Not sure how to make a stacktrace so I'll have to google that. |
|
Posted by Herbert Poul |
|
well .. i have the feeling that there is something wrong with the basics which i'm missing ;) would it be possible for you to give me shell access so i can look at it directly? just mail me at herbert.poul@gmail.com
thanks Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by mkowalski |
|
Sure, I've got it working now after a fashion. It seems like a group wasn't being set in the middleware. Had to get a couple hours out of a friend to figure it out and I'm still not sure about it.
|