Project

General

Profile

« Previous | Next » 

Revision 5074

sql_gen.py: Added is_nullable()

View differences:

lib/sql_gen.py
1043 1043

  
1044 1044
##### Database structure
1045 1045

  
1046
def is_nullable(db, value):
1047
    try: return is_null(value) or db.col_info(value).nullable
1048
    except NoUnderlyingTableException: return True # not a table column
1049

  
1046 1050
text_types = set(['character varying', 'text'])
1047 1051

  
1048 1052
def is_text_col(db, col): return db.col_info(col).type in text_types

Also available in: Unified diff