How do I alter the behavior of django.db.models.Options.contribute_to_class when testing

108 views
Skip to first unread message

crippledcanary

unread,
Aug 21, 2008, 12:39:08 PM8/21/08
to Django developers
I am working on http://code.djangoproject.com/ticket/6148.
This includes a new option "db_schema" that's been added to a models
meta class.
It involves using a custom schema for any model that has this
attribute set.
The problem comes when testing.
In postgres a test database is created and inside that one this or
these new schemas are created. Works fine when creating and dropping
the test database.
In mysql schemas are treated as ordinary databases. So a test database
gets created. I can even create the "databases" that correspond to
db_schema but these will be the same as when running "live". Not
created INSIDE the test database but in parallel to the test database
and with the same name as when running normally.

What I want to do is to alter/patch the value in db_schema with
something when create_test_db is used but not else.
This db_schema attribute has to be set at the time contribute_to_class
method of django.db.models.Options is called or before because it is
used there.

Any hints or ideas are most welcome...

//Peter Magnusson

Russell Keith-Magee

unread,
Aug 21, 2008, 7:38:51 PM8/21/08
to django-d...@googlegroups.com

My hint would be wait. We are currently in the crunch right before our
v1.0 release. Developer attention is currently focussed on fixing
existing bugs and getting v1.0 out the door; I can't speak for the
other developers, but at the moment, I simply don't have the spare
cycles to dedicate to guiding a new feature.

This doesn't mean the feature isn't worthwhile - it just means we have
slightly different priorities at the moment. If you wait about a month
(2 weeks to the release, and a few extra weeks to let us recover from
the hangover), you'll get a lot more attention for your design issues.

Yours,
Russ Magee %-)

Peter Magnusson

unread,
Aug 22, 2008, 1:32:13 AM8/22/08
to django-d...@googlegroups.com
Quite understandable. I'll drop it for the moment as I have what I
need to get my project going but as Arnold said- I'll be back..

2008/8/22, Russell Keith-Magee <freakb...@gmail.com>:


--
Peter Magnusson
cripple...@gmail.com | http://crippledcanary.se

Reply all
Reply to author
Forward
0 new messages