File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1261,9 +1261,15 @@ templates used by the :class:`ModelAdmin` views:
1261
1261
filtering based on add, change, and delete permissions::
1262
1262
1263
1263
class MyModelAdmin(admin.ModelAdmin):
1264
+ inlines = (MyInline,)
1265
+
1264
1266
def get_inline_instances(self, request, obj=None):
1265
1267
return [inline(self.model, self.admin_site) for inline in self.inlines]
1266
1268
1269
+ If you override this method, make sure that the returned inlines are
1270
+ instances of the classes defined in :attr:`inlines` or you might encounter
1271
+ a "Bad Request" error when adding related objects.
1272
+
1267
1273
.. method:: ModelAdmin.get_urls()
1268
1274
1269
1275
The ``get_urls`` method on a ``ModelAdmin`` returns the URLs to be used for
You can’t perform that action at this time.
0 commit comments