diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index c1e05ed..ac6520c 100644
a
|
b
|
return a subset of objects for this foreign key field based on the user::
|
820 | 820 | This uses the ``HttpRequest`` instance to filter the ``Car`` foreign key field |
821 | 821 | to only the cars owned by the ``User`` instance. |
822 | 822 | |
| 823 | Similarly, the ``formfield_for_manytomany`` method can be overridden. |
| 824 | For example, if an owner can own multiple cars and cars can belong to |
| 825 | multiple owners -- a many to many relationship -- you would need to |
| 826 | override the many to many field:: |
| 827 | |
| 828 | class MyModelAdmin(admin.ModelAdmin): |
| 829 | def formfield_for_manytomany(self, db_field, request, **kwargs): |
| 830 | if db_field.name == "cars": |
| 831 | kwargs["queryset"] = Car.objects.filter(owner=request.user) |
| 832 | return db_field.formfield(**kwargs) |
| 833 | return super(MyModelAdmin, self).formfield_for_manytomany(db_field, request, **kwargs) |
| 834 | |
823 | 835 | Other methods |
824 | 836 | ~~~~~~~~~~~~~ |
825 | 837 | |