Opened 10 years ago

Closed 10 years ago

Last modified 7 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


class MyModelAdmin(admin.ModelAdmin):
    def formfield_for_foreignkey(self, db_field, request, **kwargs):
        if == "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:1 Changed 10 years ago by jspeis

comment:2 Changed 10 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

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

comment:3 Changed 7 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

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