Skip to content

How do I append row to database? #63

@egeres

Description

@egeres

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions