#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:1 by , 15 years ago
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
The content in question is from: http://docs.djangoproject.com/en/dev/ref/contrib/admin/