A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| from django.db import connection, models | |
| class MyManager(Manager): | |
| def raw_as_qs(self, raw_query, params=()): | |
| """Execute a raw query and return a QuerySet. The first column in the | |
| result set must be the id field for the model. | |
| :type raw_query: str | unicode | |
| :type params: tuple[T] | dict[str | unicode, T] | |
| :rtype: django.db.models.query.QuerySet | |
| """ |
Enterprise Linux installation of ODBC is easy.
yum install unixODBC unixODBC-devel freetds freetds-devel perl-DBD-ODBC perl-local-libConfiguration isn't much harder. You'll need to edit UnixODBC's driver list to add FreeTDS as an available driver.