Passed
Branch unstable (79b831)
by Sydney
01:37
created

api.database.entry   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 16
dl 0
loc 20
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A Entry.edit() 0 2 1
A Entry.delete() 0 2 1
A Entry.__init__() 0 5 1
1
from api.database.DAL import SQLite
2
3
class Entry:
4
    id = None
5
    db = None
6
    table = None
7
    data = None
8
9
    def __init__(self, input_id, database, table_in, data):
10
        self.id = input_id
11
        self.db = database
12
        self.table = table_in
13
        self.data = data
14
15
    def edit(self, newData):
16
        SQLite.db_entry_edit(self.db, self.table, self.id, newData)
17
18
    def delete(self):
19
        SQLite.db_entry_delete(self.db, self.table, self.id)