On Mon, Jul 13, 2009 at 1:51 PM, bsisco <blake.si...@gmail.com> wrote:

>
> i double checked all of my admin settings and nothing has changed.
> however, i started commented out items i didn't need anymore
> (list_display_links and list_filter) in the admin class for this model
> and now i get a 500 error.


I don't know that it was a good idea to start making yet more changes in an
area of code that had already started behaving in a way that wasn't
understood.  In particular I am not at all sure that these changes you
describe are what have resulted in the error you show below.  What you
describe as having changed (commenting out a couple of things) would not
have caused the error you show details for.


> Below is the traceback from the log file
> that I'm getting:
>
> [Mon Jul 13 13:40:53 2009] [error] [client 66.103.240.1] mod_python
> (pid=21091, interpreter='wartrac.lormfg.com', phase='PythonHandler',
> handler='django.core.handlers.modpython'): Application error
> [Mon Jul 13 13:40:53 2009] [error] [client 66.103.240.1] ServerName:
> 'wartrac.lormfg.com'
> [Mon Jul 13 13:40:53 2009] [error] [client 66.103.240.1] DocumentRoot:
> '/home/sites'
> [Mon Jul 13 13:40:53 2009] [error] [client 66.103.240.1] URI: '/admin/
> tracker'


[much more snipped]

Egad.  In the future it would be appreciated if you could make an effort to
take that raw stuff and format it using your favorite text-processing tools
or editor so that it is at least semi-readable in email.  The tail end of
the traceback buried (twice) in all that noise is:

  File "/home/blake/django_projects/wartrac/tracker/admin.py", line 117, in
<module>
    admin.site.register(Warranty, WarrantyAdmin)
  File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py",
line 92, in register
    validate(admin_class, model)
  File
"/usr/lib/python2.5/site-packages/django/contrib/admin/validation.py", line
32, in validate
    if not hasattr(cls, field):
TypeError: hasattr(): attribute name must be string

which implies you have something that is not a string, nor a callable, in
your list_display for WarrantyAdmin.  For example I can cause that traceback
by specifying a list_display of:

    list_display = ('Author', 22, 'Pseudonym', 'Notes', 'puzzle_count')

for the ModelAdmin for one of the models in one of my projects.

This again implies your admin definitions for this model have been broken.
Specifically, the list_display specification.  Thus, your WarrantyAdmin code
would be more useful to see than the virtual host config for your site.

It's also a little puzzling that you are getting this traceback in the
Apache log, as this validation code is only run when DEBUG is set to True in
your settings -- yet if DEBUG were True, you'd be getting a debug page, not
a 500 response with the traceback logged in the Apache error log.  As you
make changes here, are you being careful to restart Apache so that you are
sure it is running the code you have changed?

Karen

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to