def append_to_pdf(self, pdf):
        if self.print_all_motions:
            motions = []
            for motion in Motion.objects.all():
                if (not motion.state.required_permission_to_see or
                        self.request.user.has_perm(motion.state.required_permission_to_see)):
                    motions.append(motion)
            motions_to_pdf(pdf, motions)
        else:
            motion_to_pdf(pdf, self.get_object())
Append PDF objects.
dataset/ETHPy150Open OpenSlides/OpenSlides/openslides/motions/views.py/MotionPDFView.append_to_pdf