gregmuellegger / django-autofixture

Can create auto-generated test data.
BSD 3-Clause "New" or "Revised" License
460 stars 118 forks source link

Fix `process_field` so that it works for m2m fields in Django 2.0 #107

Closed volrath closed 1 year ago

volrath commented 6 years ago

Support for direct assignment in manytomany fields was removed in Django 2.0 (see: https://docs.djangoproject.com/en/2.0/releases/2.0/#features-removed-in-2-0).

This commit adds an extra param to process_field to indicate that the field being processed is a m2m and assignment should be handled through .set instead.

panchr commented 6 years ago

While waiting for this to be merged, I found this library a pretty easy drop-in replacement: https://model-mommy.readthedocs.io/en/latest/index.html.

rhelms commented 6 years ago

Perhaps the tox matrix needs to updated to include Django 1.10, 1.11, and 2.0. And perhaps a further clean up to only bother with Django 1.11 under Python 2.7, and remove support for Python 3.3 since that is now EOL.

This PR is not likely to be merged while tests are failing, even if it is because the travis environment is not supporting those versions of python.

zodman commented 6 years ago

i prefer PR #110 fix the gis module too