Django Model Errors : TypeError: 'class Meta' got invalid attribute(s): using

3,334 views
Skip to first unread message

Subhodip Biswas

unread,
Jan 31, 2012, 2:22:27 PM1/31/12
to django...@googlegroups.com
Hi all,
I am newbie in django and while trying to write a database router for
using multiple database I did something like :

class Meta:
using = 'somedatabasename'

in Django models.py.

However while doing a syncdb I get an error like this :

TypeError: 'class Meta' got invalid attribute(s): using

what am I missing here??

any pointers or docs will be of great help.

-------------
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.com
http:/www.fedoraproject.org/wiki/SubhodipBiswas

Daniel Roseman

unread,
Feb 1, 2012, 6:19:01 AM2/1/12
to django...@googlegroups.com
On Tuesday, 31 January 2012 19:22:27 UTC, Subhodip Biswas wrote:
Hi all,
I am newbie in django and while trying to write a database router for
using multiple database  I did something like :

class Meta:
                using = 'somedatabasename'

in Django models.py.

However while doing a syncdb I get an error like this :

TypeError: 'class Meta' got invalid attribute(s): using

what am I missing here??

any pointers or docs will be of great help.

-------------
Regards
Subhodip Biswas

The error is quite clear: there's no 'using' attribute in Meta. Where did you get the impression that there was? It's certainly not mentioned in the comprehensive documentation on multiple databases here:

As that doc shows, the decision of what db to use for a model or query is made by the router, not by the model.
--
DR.
Reply all
Reply to author
Forward
0 new messages