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