Hello again, So i'm working on some of my old code, and a previously (or so i remember) function no longer works. When calling it my django page posts the error:
AttributeError at /audit_sheets/TEST/ 'list' object has no attribute 'user' Request Method: POST Request URL: http://support.mipscomputation.com/audit_sheets/TEST/ Exception Type: AttributeError Exception Value: 'list' object has no attribute 'user' Exception Location: /usr/local/lib/python2.4/site-packages/django/ contrib/auth/decorators.py in __call__, line 66 Python Executable: /usr/local/bin/python Python Version: 2.4.3 Python Path: ['/home/mipscomp/public_html/support', '/home/mipscomp/ public_html/support', '/usr/local/lib/python2.4/site-packages/ MySQL_python-1.2.2-py2.4-linux-i686.egg', '/usr/local/lib/python2.4/ site-packages/flup-1.0.1-py2.4.egg', '/usr/local/lib/python2.4/site- packages/python_memcached-1.43-py2.4.egg', '/usr/local/lib/python2.4/ site-packages/pycrypto-2.0.1-py2.4-linux-i686.egg', '/usr/local/lib/ python2.4/site-packages/Reportlab-2.1.0001-py2.5.egg', '/usr/local/lib/ python2.4/site-packages/django_registration-0.7-py2.4.egg', '/usr/ local/lib/python2.4/site-packages/elementtree-1.2.7_20070827_preview- py2.4.egg', '/usr/local/lib/python2.4/site-packages/docutils-0.5- py2.4.egg', '/usr/local/lib/python2.4/site-packages/setuptools-0.6c9- py2.4.egg', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4', '/usr/local/lib/python2.4/plat-linux2', '/usr/local/lib/python2.4/lib- tk', '/usr/local/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/ site-packages', '/usr/local/lib/python2.4/site-packages/PIL'] Server time: Fri, 27 Mar 2009 16:46:47 -0500 The line in question is: # timesheet_export(timesheets,date) where timesheet_export is my special lil function, and timesheets is a list of objects. Now the error seems to directly come from this: /usr/local/lib/python2.4/site-packages/django/contrib/auth/ decorators.py in __call__ 59. update_wrapper(self, view_func) 60. 61. def __get__(self, obj, cls=None): 62. view_func = self.view_func.__get__(obj, cls) 63. return _CheckLogin(view_func, self.test_func, self.login_url, self.redirect_field_name) 64. 65. def __call__(self, request, *args, **kwargs): 66. if self.test_func(request.user): ... 67. return self.view_func(request, *args, **kwargs) 68. path = urlquote(request.get_full_path()) 69. tup = self.login_url, self.redirect_field_name, path 70. return HttpResponseRedirect('%s?%s=%s' % tup) And right now i'm not sure what the decorators.py file is trying to do with regards to my function. Considering i've never explored the inner workings of decorators.py, i'm not sure exactly what it's doing in this instance. All i know is it's looking for user attributes in a list of totally unrelated objects. Any thoughts or ridicule are always appreciated! --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---