fromdjango.dbimportmodelsfromdjango.httpimportHttpResponsefrometc.adminimportCustomModelPage,adminsfromtests.testapp.modelsimportMyChildModel1classMyPageModelAdmin(admins.CustomPageModelAdmin):fields=('my_field','moy_relation')autocomplete_fields=('my_relation',)classMyPage(CustomModelPage):title='Test page 1'# set page title# Define some fields.my_field=models.CharField('some title',max_length=10)my_relation=models.ForeignKey(MyChildModel1,null=True,on_delete=models.CASCADE)admin_cls=MyPageModelAdmin# set admin class for this pagedefsave(self):...# Implement data handling from self attributes here.# self.bound_admin has some useful methods.# self.bound_request allows you to access current HTTP request.self.bound_admin.message_success(self.bound_request,f'Hey, done!')super().save()# to return a custom response you can assign self.bound_response# this can be useful, e.g. for file downloadsself.bound_response=HttpResponse(b'%)')# Register my page within Django admin.MyPage.register()