Accessing databases is pretty straightforward:
...
no = Notion(token)
db = no.databases.get(id)
And if we run db.db_query().obj.array, we can iterate over the entries in a notion database as well as see the properties of each object accessing .properties retrieves a dictionary with all the info... but I can't find a way to insert a new page in the database? I would have expected the following code to work, but it doesn't:
new_page = Page.create(
parent = LinkTo(from_object=db.obj),
properties = {
"Name": PropertyValue.create("title", "My title")
}
)
created_page = db.page_create(new_page)
Accessing databases is pretty straightforward:
And if we run
db.db_query().obj.array, we can iterate over the entries in a notion database as well as see the properties of each object accessing.propertiesretrieves a dictionary with all the info... but I can't find a way to insert a new page in the database? I would have expected the following code to work, but it doesn't: