From 08e83b263596a0a11ca150d99ee3f3bda6623bee Mon Sep 17 00:00:00 2001 From: Arya Khaligh Date: Sun, 26 Jul 2020 23:49:44 +0430 Subject: [PATCH 1/4] Integrate base.py with django2 --- autofixture/base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autofixture/base.py b/autofixture/base.py index 93bdc3f..7fd43b4 100644 --- a/autofixture/base.py +++ b/autofixture/base.py @@ -407,7 +407,11 @@ def process_field(self, instance, field): value = self.get_value(field) if value is self.IGNORE_FIELD: return - setattr(instance, field.name, value) + elif isinstance(field, related.ManyToManyField): + instance.save() + getattr(instance, field.name).set(value) + else: + setattr(instance, field.name, value) def process_m2m(self, instance, field): # check django's version number to determine how intermediary models From 1d1fde76dceac3404a5a32dfe2e175faeed397ff Mon Sep 17 00:00:00 2001 From: Arya Khaligh Date: Sun, 26 Jul 2020 23:50:50 +0430 Subject: [PATCH 2/4] Update README.rst --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 7b90176..301af04 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,8 @@ django-autofixture |build| |package| +`Compatible with Django version 2.X` + This app aims to provide a simple way of loading masses of randomly generated test data into your development database. You can use a management command to load test data through command line. From 43cbe3cdf18012dce7ee3e5dd216ebc2377524e8 Mon Sep 17 00:00:00 2001 From: Arya Khaligh Date: Sun, 26 Jul 2020 23:53:00 +0430 Subject: [PATCH 3/4] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 301af04..aa4de43 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,7 @@ django-autofixture |build| |package| -`Compatible with Django version 2.X` +> Compatible with Django version 2.X This app aims to provide a simple way of loading masses of randomly generated test data into your development database. You can use a management command to From f5962a79565c9b4c16c919b69ba430c243d1758f Mon Sep 17 00:00:00 2001 From: Arya Khaligh Date: Sun, 26 Jul 2020 23:53:52 +0430 Subject: [PATCH 4/4] Update README.rst --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index aa4de43..e777080 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,8 @@ django-autofixture |build| |package| -> Compatible with Django version 2.X +*** Compatible with Django version 2.X + This app aims to provide a simple way of loading masses of randomly generated test data into your development database. You can use a management command to