def read(self, entity=None, attrs=None, ignore=None, params=None):
        """Provide a default value for ``entity``.

        By default, ``nailgun.entity_mixins.EntityReadMixin.read provides a
        default value for ``entity`` like so::

            entity = type(self)()

        However, :class:`ContentViewPuppetModule` requires that an
        ``content_view`` be provided, so this technique will not work. Do
        this instead::

            entity = type(self)(content_view=self.content_view.id)

        """
        # read() should not change the state of the object it's called on, but
        # super() alters the attributes of any entity passed in. Creating a new
        # object and passing it to super() lets this one avoid changing state.
        if entity is None:
            entity = type(self)(
                self._server_config,
                content_view=self.content_view,  # pylint:disable=no-member
            )
        if ignore is None:
            ignore = set()
        ignore.add('content_view')
        return super(ContentViewPuppetModule, self).read(
            entity, attrs, ignore, params)
def read ( self , entity = None , attrs = None , ignore = None , params = None ) : if entity is None : entity = type ( self ) ( self . _server_config , content_view = self . content_view , ) if ignore is None : ignore = set ( ) ignore . add ( 'content_view' ) return super ( ContentViewPuppetModule , self ) . read ( entity , attrs , ignore , params )
Provide a default value for ``entity``.

        By default, ``nailgun.entity_mixins.EntityReadMixin.read provides a
        default value for ``entity`` like so::

            entity = type(self)()

        However, :class:`ContentViewPuppetModule` requires that an
        ``content_view`` be provided, so this technique will not work. Do
        this instead::

            entity = type(self)(content_view=self.content_view.id)