How to insert NULL value in SQLAlchemy?

后端 未结 3 900
离开以前
离开以前 2020-12-11 14:54

I\'ve a Table with the following column:

Column(\'type\', String(128))

How do I set this column to NULL when inserting a new r

3条回答
  •  伪装坚强ぢ
    2020-12-11 15:10

    Instead of trying

    self.type = NULL
    

    try as Yaroslav Admin suggested

    self.type = None
    

    As Python's equivalent for NULL is None.

提交回复
热议问题