-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase_query.py
46 lines (43 loc) · 1.29 KB
/
database_query.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
https://developers.notion.com/reference/post-database-query-filter
"""
from potion import Request, NotionHeader
from potion.api import *
from potion.objects import *
token = ''
nh = NotionHeader(authorization=token)
req = Request(nh.headers)
data = Filter.QueryDatabase(
query.Or(
{
"property": "Done",
"checkbox": {
"equals": True
}
},
query.QueryProperty(property_name='Done',
property_type=FilterProperty.checkbox,
conditions=FilterCondition.Checkbox.equals,
condition_value=True),
query.And(
{
"property": "Food group",
"select": {
"equals": "🥦Vegetable"
}
},
query.QueryProperty(property_name='Food group',
property_type='select',
conditions='equals',
condition_value='🥦Vegetable'),
{
"property": "Is protein rich?",
"checkbox": {
"equals": True
}
}),
)
)
print(data)
# print(req.post(url=database_create(),
# data=data))