Skip to content

Utility

mark_safe_lazy = lazy(mark_safe, str) module-attribute

Deprecated: A lazy wrapper for mark_safe function.

This function is deprecated and obsolete as of Django 4.1. It was previously used to create lazy versions of marked-safe strings, typically for form help text with HTML.

See

https://docs.djangoproject.com/en/4.1/releases/4.1/#utilities

is_object_creator(object, profile)

Check if the given profile is the creator of the object.

Parameters:

Name Type Description Default
object

The object to check ownership of.

required
profile

The profile to verify as the creator.

required

Returns:

Name Type Description
bool

True if the profile is the creator of the object, False otherwise.

Source code in django_util/utility.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
def is_object_creator(object, profile):
    """Check if the given profile is the creator of the object.

    Args:
        object: The object to check ownership of.
        profile: The profile to verify as the creator.

    Returns:
        bool: True if the profile is the creator of the object, False otherwise.
    """
    return object.profile == profile