Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#11419 closed (fixed)

Minor typo on admin dev docs?

Reported by: jspeis Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords: minor typo
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

class MyModelAdmin(admin.ModelAdmin):
    def formfield_for_foreignkey(self, db_field, request, **kwargs):
        if db_field.name == "car":
            kwargs["queryset"] = Car.object.filter(owner=request.user)
            return db_field.formfield(**kwargs)
        return super(MyModelAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)

Should this be:
...

            kwargs["queryset"] = Car.objects.filter(owner=request.user)

...
(changed object to objects)

Change History (3)

comment:2 by Russell Keith-Magee, 15 years ago

Resolution: fixed
Status: newclosed

(In [11176]) Fixed #11419 -- Corrected a minor typo in the admin docs. Thanks to jspeis for the report.

comment:3 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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