This makes alot of sense and works in my case - many thanks.

However, still unclear as to how to specify which table should be
created in which database when you do want to syncdb to both
databases. I may have 2 tables in models.py that I want to point to
db_1 and 3 tables in models.py I want to sync to db_2 - how would I go
about this?

Thanks,

Martin


On Mar 19, 9:11 am, Daniel Roseman <[email protected]> wrote:
> On Mar 19, 8:44 am, mbdtsmh <[email protected]> wrote:
>
>
>
> > Hi all - I'm trying out the multi database options in django 1.2 beta
> > on a new project. I can connect to two databases which is great.
>
> > However, I'm not sure what to do in my models.py file???
>
> > I have a single class in models.py that points to a table on a
> > different database (existing table of data).
>
> > class Data_Calcs(models.Model):
> >    name = models.CharField(max_length=10)
> >    calc1 = models.DecimalField(decimal_places=3,max_digits=7)
> >    etc...
>
> > I don't need to syncdb this as it exists on the other database (which
> > is not set as the default) I'm pointing to in my settings file. So how
> > do I say don't sync this when I perform a python manage.py syncdb
> > i.e., how do I configure this class so it is associated with the non-
> > default database????
>
> > Trying to look around for examples on the web of multidatabase stuff
> > for django but not much there apart from djangoproject docs - am I
> > missing something (I probably am!).
>
> > Any help appreciated,
>
> > Martin
>
> Getting Django not to create the table for a model in syncdb has
> nothing to do with multi-db support. You just need to set
> managed=False in the model's inner Meta class. 
> See:http://docs.djangoproject.com/en/1.1/ref/models/options/#managed
> --
> DR.

-- 
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