Opened 16 years ago

Closed 16 years ago

#10982 closed (invalid)

In the tutorial part 2, when I reached the point were we tried "StackeInLine", there was and error.

Reported by: pc Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords: tutorial, StackedInLine
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

AttributeError at /admin/polls/poll/

'module' object has no attribute 'StackedInLine'

Request Method: GET
Request URL: http://localhost:8000/admin/polls/poll/
Exception Type: AttributeError
Exception Value:

'module' object has no attribute 'StackedInLine'

Exception Location: /home/pc/python/django/mysite/../mysite/polls/admin.py in <module>, line 4
Python Executable: /usr/bin/python
Python Version: 2.5.2

Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/polls/poll/
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',
'mysite.polls']

Installed Middleware:
('django.middleware.common.CommonMiddleware',

'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response

  1. request.path_info)

File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in resolve

  1. for pattern in self.urlconf_module.urlpatterns:

File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in _get_urlconf_module

  1. self._urlconf_module = import(self.urlconf_name, {}, {}, [])

File "/home/pc/python/django/mysite/../mysite/urls.py" in <module>

  1. admin.autodiscover()

File "/usr/lib/python2.5/site-packages/django/contrib/admin/init.py" in autodiscover

  1. import("%s.admin" % app)

File "/home/pc/python/django/mysite/../mysite/polls/admin.py" in <module>

  1. class ChoiceInLine(admin.StackedInLine):

Exception Type: AttributeError at /admin/polls/poll/
Exception Value: 'module' object has no attribute 'StackedInLine'

Change History (2)

comment:1 by pc, 16 years ago

Ubuntu 8.04
Using sqlite3
All was working fine until the "StackedInLine"
My admin.py:

from mysite.polls.models import Poll, Choice
from django.contrib import admin

class ChoiceInLine(admin.StackedInLine):

model = Choice
extra = 3

class PollAdmin(admin.ModelAdmin):

#fields = ['pub_date', 'question']
fieldsets = [

(None, {'fields': question}),
('Date information', {'fields': pub_date,

'classes':collapse}),

]
inlines = [ChoiceInLine]


admin.site.register(Poll, PollAdmin)

comment:2 by dc, 16 years ago

Resolution: invalid
Status: newclosed

Inline not InLine

Note: See TracTickets for help on using tickets.
Back to Top