mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-03-16 22:20:27 +00:00
19 lines
475 B
Python
19 lines
475 B
Python
def pristinemethod(func):
|
|
"""
|
|
A decorator for handling pristine settings like callables.
|
|
|
|
Use it like this::
|
|
|
|
from configurations import Configuration, pristinemethod
|
|
|
|
class Develop(Configuration):
|
|
|
|
@pristinemethod
|
|
def USER_CHECK(user):
|
|
return user.check_perms()
|
|
|
|
GROUP_CHECK = pristinemethod(lambda user: user.has_group_access())
|
|
|
|
"""
|
|
func.pristine = True
|
|
return staticmethod(func)
|