partsdb

electronic parts inventory
git clone https://git.e1e0.net/partsdb.git
Log | Files | Refs

commit 0f4432ca52571852e1a0e428a22f9cbc0c14c536
parent a0a9bda5a6649244659392817155fd836aeaa7bc
Author: Paco Esteban <paco@e1e0.net>
Date:   Mon, 15 Mar 2021 19:57:14 +0100

better naming for list functions

Diffstat:
Mdatabase.py | 4++--
Mpartsdb.py | 4++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/database.py b/database.py @@ -99,12 +99,12 @@ class PartsDB(): c.execute(GET_STORAGES_QUERY) return c.fetchall() - def get_parts(self): + def list_parts(self): c = self.conn.cursor() c.execute(LIST_PARTS_QUERY) return c.fetchall() - def get_parts_with_category(self, category): + def list_parts_by_category(self, category): c = self.conn.cursor() c.execute(LIST_PARTS_CATEGORY_QUERY, (category,)) return c.fetchall() diff --git a/partsdb.py b/partsdb.py @@ -115,9 +115,9 @@ def add_part(mpn, quantity, category, storage, part_type): def list_parts(category, short): if category == 'all': - parts = db.get_parts() + parts = db.list_parts() else: - parts = db.get_parts_with_category(category) + parts = db.list_parts_by_category(category) if not parts: print("There are no parts in this category")