snakelet.storage.document.Document.is_new()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
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