-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: main
Are you sure you want to change the base?
Conversation
729fd87
to
d348536
Compare
super().contribute_to_class(cls, name, private_only=private_only, **kwargs) | ||
|
||
if not cls._meta.abstract: | ||
# If the embedded_model argument is a string, resolve it to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the embedded_models is a list of string...
or it is an string?
def test_array_slice(self): | ||
self.assertSequenceEqual(Owner.objects.filter(pets__0_1__name="Woofer"), [self.fred]) | ||
|
||
# def test_filter_unsupported_lookups_in_json(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this test a valid test or shouldn't be considered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that transform is almost the same, it will work in the same way. So, it is already tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the commented tests are copied from EmbeddedModelArrayField tests. I don't think they need to be re-implemented here, but I left them for your opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transform.get_transform
is the same, the lookups will work in the same way. So, they aren't needed and the lookups are also registered.
d348536
to
e9ae1a5
Compare
todo: