liuyang1520 / django-command-extensions

Automatically exported from code.google.com/p/django-command-extensions
MIT License
0 stars 0 forks source link

dumpscript and explicit intermediate join tables #48

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The new feature in Django 1.0 that allows explicit intemediate join tables,
and therefore relationship attributes, has a different API to a standard
many to many field.

This means that when dumpscript adds such a line for a Many-to-many field
with intermediate join model:
    my_object.things.add(other_object)
it will fail.

The simple solution is to simply remove this line, because the intermediate
table is a standard table and the relationship objects will be added anyway.

If you can work out which fields require this.

Original issue reported on code.google.com by e.willha...@gmail.com on 13 Sep 2008 at 3:46

GoogleCodeExporter commented 8 years ago
Here is a patch that should address this issue.

Original comment by e.willha...@gmail.com on 13 Sep 2008 at 3:49

Attachments:

GoogleCodeExporter commented 8 years ago
Of course, for backwards compatibility, has there always been a "creates_table"
attribute on fields? I couldn't find it in my "legacy" checkout, so here is a 
more
cautious patch.

Original comment by e.willha...@gmail.com on 13 Sep 2008 at 3:55

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by e.willha...@gmail.com on 15 Mar 2009 at 10:32

GoogleCodeExporter commented 8 years ago
Anybody know if this is in the "snapshot of the current version" from github or 
would
I have to apply the patch manually?

Original comment by Eric.Fre...@gmail.com on 21 Apr 2009 at 8:24

GoogleCodeExporter commented 8 years ago
I've tried the patch but it doesn't prevent the parent model from trying the 
add on the intermediary model. Can you verify that this works?

Original comment by neilpa...@gmail.com on 17 Jan 2011 at 11:36