Simplify db ORM method names
This commit is contained in:
parent
23e90a4413
commit
8908290c4d
@ -68,7 +68,7 @@ class ActivitiesScreen(ListScreen):
|
||||
self.table.clear()
|
||||
|
||||
# List activities with the count of facts
|
||||
activities = Activity.list_activities(self.db_manager, filter_query)
|
||||
activities = Activity.list(self.db_manager, filter_query)
|
||||
|
||||
self.table.add_rows(
|
||||
[
|
||||
@ -144,7 +144,7 @@ class CategoriesScreen(ListScreen):
|
||||
def _refresh(self, filter_query=None):
|
||||
self.table.clear()
|
||||
|
||||
categories = Category.list_categories(
|
||||
categories = Category.list(
|
||||
self.db_manager, filter_query=filter_query
|
||||
)
|
||||
|
||||
|
@ -38,7 +38,7 @@ class Category(BaseORM):
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def list_categories(db_manager, filter_query=None):
|
||||
def list(db_manager, filter_query=None):
|
||||
cursor = db_manager.get_cursor()
|
||||
where = ""
|
||||
if filter_query is not None:
|
||||
@ -120,7 +120,7 @@ class Activity(BaseORM):
|
||||
self.conn.commit()
|
||||
|
||||
@staticmethod
|
||||
def list_activities(db_manager, filter_query=None):
|
||||
def list(db_manager, filter_query=None):
|
||||
cursor = db_manager.get_cursor()
|
||||
where = ""
|
||||
if filter_query is not None:
|
||||
@ -195,7 +195,7 @@ class Fact(BaseORM):
|
||||
super().__init__(db_manager, "facts", id, activity_id=activity_id)
|
||||
|
||||
@staticmethod
|
||||
def list_facts(db_manager):
|
||||
def list(db_manager):
|
||||
cursor = db_manager.get_cursor()
|
||||
cursor.execute("SELECT * FROM facts")
|
||||
rows = cursor.fetchall()
|
||||
|
Loading…
Reference in New Issue
Block a user