snakelet.storage.document   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A Document.is_new() 0 2 1
1
class Document(dict):
2
    __getattr__ = dict.get
3
    __delattr__ = dict.__delitem__
4
    __setattr__ = dict.__setitem__
5
6
    """
7
    def __init__(self, **kwargs):
8
        # Parental
9
        super().__init__(**kwargs)
10
        self.__meta__ = {}
11
12
    def __add_meta__(self, key, type):
13
        self.__meta__[key] = type
14
        return
15
    """
16
17
    def is_new(self):
18
        return self.get('_id') is None
19