We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9e9ab9 commit 99907ceCopy full SHA for 99907ce
README.md
@@ -101,6 +101,12 @@ table_rows = client.table_row_list(project, table_name, params={'offset': 100})
101
table_rows = client.table_row_list(project, table_name, InFilter("name", "sam"))
102
table_rows = client.table_row_list(project, table_name, filter_obj=EqFilter("Id", 100))
103
104
+# Filter and count rows
105
+count = client.table_count(project, table_name, filter_obj=EqFilter("Id", 100))
106
+
107
+# Find one row
108
+table_row = client.table_find_one(project, table_name, filter_obj=EqFilter("Id", 100), params={"sort": "-created_at"})
109
110
# Retrieve a single row
111
row_id = 10
112
row = client.table_row_detail(project, table_name, row_id)
nocodb/api.py
@@ -26,6 +26,22 @@ def get_table_uri(self, project: NocoDBProject, table: str) -> str:
26
)
27
28
29
+ def get_table_count_uri(self, project: NocoDBProject, table: str) -> str:
30
+ return "/".join(
31
+ (
32
+ self.get_table_uri(project, table),
33
+ 'count'
34
+ )
35
36
37
+ def get_table_find_one_uri(self, project: NocoDBProject, table: str) -> str:
38
39
40
41
+ 'find-one'
42
43
44
45
def get_row_detail_uri(
46
self, project: NocoDBProject, table: str, row_id: int
47
):
nocodb/infra/requests_client.py
@@ -78,6 +78,31 @@ def table_row_delete(self, project: NocoDBProject, table: str, row_id: int) -> i
78
self.__api_info.get_row_detail_uri(project, table, row_id),
79
).json()
80
81
+ def table_count(
82
+ self,
83
+ project: NocoDBProject,
84
+ table: str,
85
+ filter_obj: Optional[WhereFilter] = None,
86
+ ) -> dict:
87
+ return self._request(
88
+ "GET",
89
+ self.__api_info.get_table_count_uri(project, table),
90
+ params=get_query_params(filter_obj),
91
+ ).json()
92
93
+ def table_find_one(
94
95
96
97
98
+ params: Optional[dict] = None,
99
100
+ self.__api_info.get_table_find_one_uri(project, table),
+ params=get_query_params(filter_obj, params),
def table_row_nested_relations_list(
self,
project: NocoDBProject,
nocodb/utils.py
@@ -1,4 +1,4 @@
1
-def get_query_params(filter_obj, params) -> dict:
+def get_query_params(filter_obj, params=None) -> dict:
2
query_params = params or {}
3
if filter_obj:
4
query_params["where"] = filter_obj.get_where()
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments