On Thu, Feb 19, 2015 at 4:56 AM, Andrew Pinkham <m...@andrewsforge.com> wrote:
> Hi Micky,
> When I had to migrate FK->M2M, I found that hand-hacking a migration file was 
> the way to go. I wrote a multiple operation migration class that did the 
> following:
>
> 1. create a M2M, nullable field, and set all defaults to null

An M2M link between two models is created by inserting a row in to a
join table that contains a foreign key to the first model and a
foreign key to the second model. If they are not linked, there is no
row in the table with those keys.

How will either of those keys ever be null?

Django accepts the keyword argument "null" on all fields, but it is
meaningless for an M2M.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1KCevqKtBmmws95c11r0DY%2BRUtWhEKFw3BXWbBZZp-yqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to