Skip to content

INTPYTHON-658 Add PolymorphicEmbeddedModelArrayField #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 24, 2025

Conversation

timgraham
Copy link
Collaborator

@timgraham timgraham commented Jul 8, 2025

No description provided.

@timgraham timgraham force-pushed the polymorphic-array branch from 729fd87 to d348536 Compare July 14, 2025 20:25
@timgraham timgraham marked this pull request as ready for review July 14, 2025 21:43
@timgraham timgraham requested a review from WaVEV July 14, 2025 21:43
@timgraham timgraham force-pushed the polymorphic-array branch from d348536 to e9ae1a5 Compare July 16, 2025 13:11
Comment on lines +25 to +27
if not cls._meta.abstract:
# If embedded_models contains any strings, replace them with the actual
# model classes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How could this class ever come back as an abstract one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the field is declared on an abstract model.

(The condition is copied from django.db.models.fields.related.RelatedField.contribute_to_class().)

@@ -89,7 +89,7 @@ def convert_value(value, expression, connection):
def get_db_converters(self, expression):
converters = super().get_db_converters(expression)
internal_type = expression.output_field.get_internal_type()
if internal_type == "ArrayField":
if internal_type.endswith("ArrayField"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@timgraham timgraham force-pushed the polymorphic-array branch from e9ae1a5 to 6d1f396 Compare July 23, 2025 18:30
@timgraham timgraham merged commit 6d1f396 into mongodb:main Jul 24, 2025
15 checks passed
@timgraham timgraham deleted the polymorphic-array branch July 24, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants