Skip to content
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

Implement productrecommendations #19

Merged
merged 6 commits into from
Feb 26, 2024
Merged

Conversation

viggo-devries
Copy link
Contributor

No description provided.

fields = self.get_fields_to_update(relation.related_model)
if fields is not None:
validated_m2m_instances = self.validate_instances(instances)
relation.related_model.objects.bulk_create(validated_m2m_instances)
if relation.related_model != self.Model:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we assume that validate_resources is sufficient for product fields as this skips some custom clean methods of Product model?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes indeed I think so. For parents this was not an issue because of the structure (it tests different things) but for standalones they check if the title and slug are not none which we don't care about at this point.

Maybe we should only do this in the productmodelcontext and not in the normal modelcontext
like make it a settings on the context? What do you think

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, thats better

@samar-hassan samar-hassan merged commit c9fcb74 into master Feb 26, 2024
5 checks passed
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.

2 participants