django-seo2 icon indicating copy to clipboard operation
django-seo2 copied to clipboard

populate_from does not work for literals

Open eriktelepovsky opened this issue 8 years ago • 0 comments
trafficstars

Documentation says it is possible to pass literal value as a default value for tags:

http://django-seo2.readthedocs.io/en/latest/reference/definition.html?highlight=default#populate_from

... but it does not work (the tag won't show up in the header):

class MyMetadata(seo.Metadata):
    description = seo.MetaTag(max_length=155, populate_from='Default description')

but a callback works:

def default_description(metadata, **kwargs):
    return "Default description"
default_description.short_description = "Standard description will be used"

class MyMetadata(seo.Metadata):
    description = seo.MetaTag(max_length=155, populate_from=default_description)

eriktelepovsky avatar May 22 '17 12:05 eriktelepovsky