To the maintainers of third-party Django database backends (like DB2,
etc.) and whoever else is hacking/patching/corrupting the code in
django.db.backends for fun or profit --

With the help of Alex Gaynor, I've just checked in a light refactoring
of the database backends such that Django database objects
(BaseDatabaseWrapper instances) now keep track of their own database
settings. This makes it easier to add multiple-database support to
Django, and it's cleaner overall for the connection objects to deal
with dictionaries rather than bulky Django settings module objects.

This is backwards-compatible for end users but will likely break
third-party database backends or any other code that hacks around in
there. Specific API changes are:

* BaseDatabaseWrapper.__init__() now takes a settings_dict instead of
a settings module. It's called settings_dict to disambiguate, and for
easy grepability. This should be a dictionary containing
DATABASE_NAME, etc.

* BaseDatabaseWrapper has a settings_dict attribute instead of an
options attribute. BaseDatabaseWrapper.options is now
BaseDatabaseWrapper['DATABASE_OPTIONS']

* BaseDatabaseWrapper._cursor() no longer takes a settings argument.

* BaseDatabaseClient.__init__() now takes a connection argument (a
DatabaseWrapper instance) instead of no arguments.

The full changeset is here: http://code.djangoproject.com/changeset/10026

It's a pretty straightforward refactoring, but if you have any
technical questions on how to upgrade third-party backends or your own
hacks, please just respond to this and I'll try to help. If you don't
get a response within a day or so, just e-mail me off-list to get my
attention.

Adrian

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to