bodacydo
bodacydo

Reputation: 79309

How to set value NULL to a field in SQLAlchemy?

I've a Table called journals in SqlAlchemy that has one of the following Columns:

Column('type', String(128))

Then I've mapper that maps journals to Journals python class:

mapper(Journals, journals);

I want to insert a new row in journals and set type to NULL.

What would be the corresponding Python type to NULL?

Here's example:

self.type = NULL;

There is no NULL type in Python so I don't know how to do it.

Upvotes: 0

Views: 7353

Answers (1)

adarsh
adarsh

Reputation: 6978

You should use None. None is the equivalent to NULL in Python.

Upvotes: 7

Related Questions