#18576: Missing module in import statement
-------------------------------+------------------------------------
Reporter: jaaruiz@… | Owner: claudep
Type: Bug | Status: assigned
Component: Documentation | Version: 1.4
Severity: Normal | Resolution:
Keywords: wrong example | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by claudep):
* status: new => assigned
* needs_better_patch: => 0
* needs_tests: => 0
* owner: nobody => claudep
* needs_docs: => 0
* stage: Unreviewed => Accepted
Old description:
> A necessary module is not being imported in one of the examples. The
> example is located at
> https://docs.djangoproject.com/en/dev/intro/tutorial02/
>
> The example code is as follows:
>
> from django.contrib import admin
> from polls.models import Poll
>
> class ChoiceInline(admin.StackedInline):
> model = Choice
> extra = 3
>
> class PollAdmin(admin.ModelAdmin):
> fieldsets = [
> (None, {'fields': ['question']}),
> ('Date information', {'fields': ['pub_date'], 'classes':
> ['collapse']}),
> ]
> inlines = [ChoiceInline]
>
> admin.site.register(Poll, PollAdmin)
>
>
>
> The second line of the code should also import the `Choice' model as
> follows:
> from polls.models import Poll, Choice
New description:
A necessary module is not being imported in one of the examples. The
example is located at
https://docs.djangoproject.com/en/dev/intro/tutorial02/
The example code is as follows:
{{{
from django.contrib import admin
from polls.models import Poll
class ChoiceInline(admin.StackedInline):
model = Choice
extra = 3
class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question']}),
('Date information', {'fields': ['pub_date'], 'classes':
['collapse']}),
]
inlines = [ChoiceInline]
admin.site.register(Poll, PollAdmin)
}}}
The second line of the code should also import the `Choice' model as
follows:
from polls.models import Poll, Choice
--
--
Ticket URL: <https://code.djangoproject.com/ticket/18576#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en.