I'm faced with the multiple-schema problem in MySQL, which AFAICT is a
lot simpler than actually having multiple databases because at least
you don't have to coordinate multiple connections. Actually, it
basically already works. I wrote

class Poll(meta.Model):
    class META:
        db_table = "myschema.poll"

but then Django tries to quote the whole name (including the period)
which of course makes MySQL complain (beause the SQL should be
`myschema`.`poll`, not `myschema.poll`). So I hacked
DatabaseWrapper.quote_name so that it doesn't quote periods, but is
that the "right" way to handle this or is it an ugly hack? It seems to
work very well, but it feels like it might be cleaner to add a
db_schema attribute or something instead. (Should I submit a patch? :-)

Reply via email to