-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3849 from allegro/fix-other-m2m-polymorphic-save
Fix other m2m polymorphic save
- Loading branch information
Showing
9 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/ralph/deployment/migrations/0009_auto_20240924_1133.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.8 on 2024-09-24 11:33 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
import ralph.lib.polymorphic.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('deployment', '0008_auto_20240705_1210'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='preboot', | ||
name='items', | ||
field=ralph.lib.polymorphic.fields.PolymorphicManyToManyField(blank=True, to='deployment.PrebootItem', verbose_name='files'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.db.models import ManyToManyField | ||
|
||
|
||
class PolymorphicManyToManyField(ManyToManyField): | ||
def save_form_data(self, instance, data): | ||
getattr(instance, self.attname).set(data[:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/ralph/lib/polymorphic/tests/migrations/0004_auto_20240924_1142.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.8 on 2024-09-24 11:42 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
import ralph.lib.polymorphic.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('polymorphic_tests', '0003_auto_20240506_1133'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='somem2mmodel', | ||
name='polymorphics', | ||
field=ralph.lib.polymorphic.fields.PolymorphicManyToManyField(related_name='some_m2m', to='polymorphic_tests.PolymorphicModelBaseTest'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.8 on 2024-09-24 11:55 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
import ralph.lib.polymorphic.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('networks', '0015_auto_20211115_1125'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='network', | ||
name='terminators', | ||
field=ralph.lib.polymorphic.fields.PolymorphicManyToManyField(blank=True, to='assets.BaseObject', verbose_name='network terminators'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters