django-content-settings icon indicating copy to clipboard operation
django-content-settings copied to clipboard

binary instead of simple string for illustrating that this string should be converted into function

Open oduvan opened this issue 6 months ago • 0 comments

Current (0.19) version: callable attributes can be set as string

    fetch_permission: TCallableStr = "none"
    update_permission: TCallableStr = "staff"
    view_permission: TCallableStr = "staff"

so the function that parses that attribute knows where to get a callable object instead.

But as an option you can use binary object, and b prefix to the string would illustrate that this will become an object

    fetch_permission: TCallableStr = b"none"
    update_permission: TCallableStr = b"staff"
    view_permission: TCallableStr = b"staff"

in the future we will use binary value to convert not only functions

oduvan avatar Aug 09 '24 09:08 oduvan