Thank you so very much!! It worked exactly like I wanted. I had been through
the django tickets, but since this ticket has no keywords, I wasn't able to
find it... It's sad to see that this is being going on for nearly 3 years!!!

In my case, I had my tables 'syncdb'ed already, so it was not an issue for
me. But it's well worth the effort to comment out the field definition on
the second table before the 'syncdb', then remove the comment afterward.

[]s
Nelson

On Sat, Dec 6, 2008 at 4:47 AM, anode <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I'm not an expert either, but I think you can get what you want using
> a technique from here:
> http://code.djangoproject.com/ticket/897
>
> Basically you just tell your Track model it's part of a many to many
> relationship like this:
>
> class Track(models.Model):
>    name = models.CharField(max_length = 50)
>    records = models.ManyToManyField('Record', db_table =
> 'music_record_tracks')
>
> The only issue with this is that running sync_db with this kind of set-
> up might not work too well, as it would probably try to create the
> intermediary many-to-many table twice. I think this will only happen
> if the Track database table doesn't exist when syncdb is run, so it
> should be fine in your case, but beware if you try to set up a
> database from scratch. Just comment out the many-to-many field in the
> Track model temporarily when you set up a new database and syncdb
> should run ok.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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