Ejemplo n.º 1
0
    def set_social_texts(self, context):
        resolver_args = self.get_resolver_args()

        if resolver_args[0] in settings.SOCIAL_MEDIA_TEXTS:
            social_texts = settings.SOCIAL_MEDIA_TEXTS[resolver_args[0]]

            for key, value in social_texts.items():
                if isinstance(value, (str, Promise)):
                    value = value % self.request.site
                context[key] = value

        # set default canonical URL
        context.setdefault('canonical_url', canonical_link(self.request.path))
Ejemplo n.º 2
0
    def set_social_texts(self, context):
        resolver_args = self.get_resolver_args()

        if resolver_args[0] in settings.SOCIAL_MEDIA_TEXTS:
            social_texts = settings.SOCIAL_MEDIA_TEXTS[resolver_args[0]]

            for key, value in social_texts.items():
                if isinstance(value, (str, Promise)):
                    value = value % self.request.site
                context[key] = value

        # set default canonical URL
        context.setdefault('canonical_url', canonical_link(self.request.path))
Ejemplo n.º 3
0
Archivo: models.py Proyecto: eyzx7x/hp
 def get_canonical_url(self):
     """Get the full canonical URL of this object."""
     return canonical_link(self.get_absolute_url())
Ejemplo n.º 4
0
 def get_canonical_url(self):
     """Get the full canonical URL of this object."""
     return canonical_link(self.get_absolute_url())