(self)
return slug
The main slug of the podcast

        TODO: should be retrieved from a (materialized) view
The main slug of the podcast
The main slug of the podcast
def slug(self):
        """The main slug of the podcast

        TODO: should be retrieved from a (materialized) view"""

        # We could also use self.slugs.first() here, but this would result in a
        # different query and would render a .prefetch_related('slugs') useless
        # The assumption is that we will never have loads of slugs, so
        # fetching all won't hurt
        slugs = list(self.slugs.all())
        slug = slugs[0].slug if slugs else None
        logger.debug("Found slugs %r, picking %r", slugs, slug)
        return slug
def slug ( self ) : # We could also use self.slugs.first() here, but this would result in a # different query and would render a .prefetch_related('slugs') useless # The assumption is that we will never have loads of slugs, so # fetching all won't hurt slugs = list ( self . slugs . all ( ) ) slug = slugs [ 0 ] . slug if slugs else None logger . debug ( "Found slugs %r, picking %r" , slugs , slug ) return slug