mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-05-05 12:32:28 +00:00
[Update] Add settings api
This commit is contained in:
@@ -2,3 +2,4 @@
|
||||
#
|
||||
|
||||
from .ldap import *
|
||||
from .common import *
|
||||
|
||||
18
apps/settings/utils/common.py
Normal file
18
apps/settings/utils/common.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# coding: utf-8
|
||||
|
||||
|
||||
class ObjectDict(dict):
|
||||
def __getattr__(self, name):
|
||||
if name in self:
|
||||
return self[name]
|
||||
else:
|
||||
raise AttributeError("No such attribute: " + name)
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
self[name] = value
|
||||
|
||||
def __delattr__(self, name):
|
||||
if name in self:
|
||||
del self[name]
|
||||
else:
|
||||
raise AttributeError("No such attribute: " + name)
|
||||
Reference in New Issue
Block a user