scipy / SciPyCentral

SciPy Central
http://scipy-central.org
BSD 3-Clause "New" or "Revised" License
16 stars 12 forks source link

Make query compatible with all general databases #192

Closed ksurya closed 8 years ago

ksurya commented 9 years ago

Bug: https://github.com/scipy/SciPyCentral/blob/master/scipy_central/submission/models.py#L165 Issue started at: https://github.com/scipy/SciPyCentral/commit/f662009e8c2c5f27ea4f1a27046c8410014c5eb0#diff-861e44c0c9e84611f3205414b6835952

The query mentioned in RevisionManager.most_recent() method containing __sr_2.is_displayed = 1. This conditional expression's syntax on a boolean column varies for different databases.

For PostgreSQL its __sr_2.is_displayed = true

As every query so far in the database is compatible with all relational database, maintaining this query as well makes the code flexible to use any db!

ksurya commented 8 years ago

Fixed in https://github.com/scipy/SciPyCentral/pull/198