mine.models._bases.NameMixin.__str__()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
"""Shared base classes and mixins."""
2
3
4 1
class NameMixin:
5
    """Mixin class for objects identified by their name."""
6
7 1
    def __str__(self):
8 1
        return str(self.name)
9
10 1
    def __eq__(self, other):
11 1
        return str(self).lower() == str(other).lower()
12
13 1
    def __ne__(self, other):
14 1
        return not self.__eq__(other)
15
16 1
    def __lt__(self, other):
17
        return str(self).lower() < str(other).lower()
18