@with_session
def create_list(list_name, session=None):
 regexp_list = get_list_by_exact_name(list_name, session=session)
 if (not regexp_list):
  regexp_list = RegexpListList(name=list_name)
  session.merge(regexp_list)
  session.commit()
 return regexp_list

@ with_session def create_list ( list_name , session = None ) : regexp_list = get_list_by_exact_name ( list_name , session = session ) if ( not regexp_list ) : regexp_list = RegexpListList ( name = list_name ) session . merge ( regexp_list ) session . commit ( ) return regexp_list
only creates the list if it doesnt exist .