ramnes / notion-sdk-py

The official Notion API client library, but rewritten in Python! (sync + async)
https://ramnes.github.io/notion-sdk-py
MIT License
1.8k stars 140 forks source link

notion.databases.create: Is it possible to rearrange database fields according to some defined order? #204

Open andrewshvv opened 1 year ago

andrewshvv commented 1 year ago

I am trying to create a database, but I want fields of the database to be ordered a specific way. Am I correct in my assumption that because API receives a dict rather than a list of tuples the order can't be defined, at least at the stage of database creation? If so, are the any known ways of doing it?

andrewshvv commented 1 year ago

Okay, seems like fields are ordered in the alphabetic order, so adding a prefix like 01. ... 0N. helps, but this is ugly as hell.

ramnes commented 1 year ago

I wonder if this is just how Notion's API works, or if it's the JSON we send that has been reordered somehow, e.g. because of json.dumps?