On Friday, September 17, 2010, Stodge <[email protected]> wrote:
> I have a bunch of models and I want to specify which models (tables)
> are stored on which PostgreSQL database. I've read the documentation
> and I know I can use the using() function. I'm just wondering this
> can't be specified in the model's meta data:
>
>     class Meta:
>         using = 'db_name'
>
> or:
>
>
>     class Meta:
>         db_server = 'db_name'
>
> Where the db_name maps to the name specified in settings.py. I'm
> adding in Django support to an existing application so this would
> avoid littering my code with using() function calls. I know I could
> use a database router but that seems like overkill when it makes more
> sense to define the database in the model's meta data. Any ideas why
> this is?

Tying this to your app/model makes it very un-reusable. While a router
is at the project level.

-Preston
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

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

Reply via email to