Hey,
I've got django installed on a webserver with apache / mod_python /
mysql (on debian). I've got the latest svn version of django
installed.
I'm runinng through the tutorials but I'm getting some strange results.
Tutorial 1 went fine, so I've got the Poll / Choice models and I can
work with their api through the python shell just fine.
In tutorial 2 however I've now got this:
"""
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Admin:
pass
def __unicode__(self):
return self.question
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()
"""
So as you see I've added the Admin class. This does make the poll show
up in the admin interface but it seems very unreliable. When I refresh
the index page sometimes 'poll' is there and other times it isn't.
When it is there and I click on it, often it shows an error page:
"""
AttributeError at /admin/polls/poll/add/
'NoneType' object has no attribute 'get_field_sets'
Request Method: GET
Request URL: http://__myurl__/admin/polls/poll/add/
Exception Type: AttributeError
Exception Value: 'NoneType' object has no attribute 'get_field_sets'
Exception Location:
/usr/lib/python2.4/site-packages/django/contrib/admin/views/main.py
in render_change_form, line 200
Python Executable: /usr/bin/python
Python Version: 2.4.4
"""
However, sometimes when I click on it, it does just work and I can
then add / edit poll objects.
I've also added an Admin class to the Choice object but it doesn't
appear in the admin interface at all. And when I try to hack the url a
bit by manually going to admin/choices/choice/ I get the error: "App
u'choices', model u'choice', not found"
I get the same behaviour in both firefox and safari. Also the admin
interface does seem to work well for the default apps users & groups.
Does this sound familiar to anyone?
Greets,
Timothy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---