Skip to content

Conversation

fsbraun
Copy link
Member

@fsbraun fsbraun commented Feb 4, 2023

Description

The admin_manager of a versioned model provided access to current_content_iterator which allowed to "filter" out all current versions of the model: Either draft or published (if there is no draft). This API had the drawback that the result was not a queryset but an iterator (since the grouping was done in python).

This method is now replaced by current_content() which is a filter that returns a queryset that only contains the current verison of the objects. Not only is it more convenient to have a qs returned, the number of database hits reduces from O(n) with n being the number of objects to 1.

current_content_iterator is kept to ensure compatibility with django CMS v4.1.0rc1

Related resources

  • #...
  • #...

Checklist

  • I have opened this pull request against master
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined #workgroup-pr-review on
    Slack to find a “pr review buddy” who is going to review my pull request.

@codecov
Copy link

codecov bot commented Feb 4, 2023

Codecov Report

Merging #318 (28ee6a6) into master (906d501) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #318   +/-   ##
=======================================
  Coverage   89.91%   89.91%           
=======================================
  Files          68       68           
  Lines        2250     2251    +1     
  Branches      301      300    -1     
=======================================
+ Hits         2023     2024    +1     
  Misses        172      172           
  Partials       55       55           
Impacted Files Coverage Δ
djangocms_versioning/managers.py 82.69% <100.00%> (+0.33%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@fsbraun fsbraun merged commit 65f6da9 into django-cms:master Feb 4, 2023
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