ODM2 / WOFpy

A server-side implementation of CUAHSI's Water One Flow service stack in Python.
http://odm2.github.io/WOFpy/
9 stars 9 forks source link

Add MSSQL handling for dao query #174

Closed lsetiawan closed 7 years ago

lsetiawan commented 7 years ago

Overview

This PR addresses #157. Dao now can handle mssql when querying.

emiliom commented 7 years ago

In the test for database (engine) name, like this:

if self.engine.name is 'postgresql' or self.engine.name is 'mssql':

why are you using the is operator rather than ==? The is operator is intended for comparisons to other object literals. A string comparison should use ==. Assuming self.engine.name returns a simple string literal, the if test can then be made a bit more compact and readable:

if self.engine.name in ('postgresql', 'mssql'):

Obviously this is not a critical issue! But it was bugging me a bit ...