djangocms_page_tags.utils¶
Warning
While functions in this module can be used in code to work with the tags, they are by no means to be considered as a stable API, so they may change in future release.
Create the cache key for the current page and tag type
Retrieves all the tags for a Page instance.
Parameters: page – a Page instance Returns: list or queryset of attached tags Type: List
Get the list of tags attached to a Page or a Title from a request from usual page_lookup parameters.
Parameters: - request – request object
- page_lookup – a valid page_lookup argument
- lang – a language code
- site – a site id
- title – a boolean to extract the Page (if False) or Title instance
Returns: list of tags
Type: List
Retrieves all the tags for a Title (given as page and language). This function does not use fallbacks to retrieve title object.
Parameters: - page – a Page instance
- lang – a language code
Returns: list or queryset of attached tags
Type: List
Get the list of tags attached to a Title from a request from usual page_lookup parameters.
Parameters: - request – request object
- page_lookup – a valid page_lookup argument
- lang – a language code
- site – a site id
Returns: list of tags attached to the given Title
Type: List
Check if a Page object is associated with the given tag.
Parameters: - page – a Page instance
- tag – a Tag instance or a slug string.
Returns: whether the Page instance has the given tag attached (False if no Page or no attached PageTags exists)
Type: Boolean
Check if a Title object is associated with the given tag. This function does not use fallbacks to retrieve title object.
Parameters: - page – a Page instance
- lang – a language code
- tag – a Tag instance or a slug string.
Returns: whether the Title instance has the given tag attached (False if no Title or no attached TitleTags exists)
Type: Boolean