def insert_draft_child(self, child_pid):
        """Insert a draft child to versioning."""
        if child_pid.status != PIDStatus.RESERVED:
            raise PIDRelationConsistencyError(
                "Draft child should have status 'RESERVED'")

        if not self.draft_child:
            with db.session.begin_nested():
                super(PIDNodeVersioning, self).insert_child(child_pid,
                                                            index=-1)
        else:
            raise PIDRelationConsistencyError(
                "Draft child already exists for this relation: {0}".format(
                    self.draft_child))
def insert_draft_child ( self , child_pid ) : if child_pid . status != PIDStatus . RESERVED : raise PIDRelationConsistencyError ( "Draft child should have status 'RESERVED'" ) if not self . draft_child : with db . session . begin_nested ( ) : super ( PIDNodeVersioning , self ) . insert_child ( child_pid , index = - 1 ) else : raise PIDRelationConsistencyError ( "Draft child already exists for this relation: {0}" . format ( self . draft_child ) )
Insert a draft child to versioning.