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

Simple clean up changes. #166

Merged
merged 1 commit into from
Jun 2, 2018
Merged

Conversation

sdolemelipone
Copy link
Collaborator

  1. Moved BaseFormSetMixin.success_url to FormSetMixin.success_url, as this specifically relates to functionality of a subclassed view.
  2. Removed ModelFormSetMixin.get_context_data() method as django now uses self.object_list correctly (rather than requiring it to be in **kwargs which was previously the case).
  3. ModelFormSetMixin.get_factory_kwargs and InlineFormSetMixin.get_factory_kwargs were both calling self().get_formset_class() a second time even though this would already have been called by BaseFormSetMixin.factory_kwargs() as part of the super() call. The extra calls have been removed.
  4. Removed explicit setting of BaseInlineFormSetMixin.formset_class and GenericInlineFormSetMixin.formset_class as the defaults for inlineformset_factory and genericinlineformset_factory set this automatically.
  5. Removed BaseInlineFormSetMixin.get_context_data as this will already be set by SingleObjectMixin.get_context_data when subclassed.
  6. Switched subclassing of InlineFormSetMixin so that SingleObjectMixin.get_context_data will be called ahead of FormSetMixin.get_context_data (as ContextMixin.get_context_data does not super() itself).

1. Moved BaseFormSetMixin.success_url to FormSetMixin.success_url, as this specifically relates to functionality of a subclassed view.
2. Removed ModelFormSetMixin.get_context_data() method as django now uses self.object_list correctly (rather than requiring it to be in **kwargs which was previously the case).
3. ModelFormSetMixin.get_factory_kwargs and InlineFormSetMixin.get_factory_kwargs were both calling self().get_formset_class() a second time even though this would already have been called by BaseFormSetMixin.factory_kwargs() as part of the super() call. The extra calls have been removed.
4. Removed explicit setting of BaseInlineFormSetMixin.formset_class and GenericInlineFormSetMixin.formset_class as the defaults for inlineformset_factory and genericinlineformset_factory set this automatically.
5. Removed BaseInlineFormSetMixin.get_context_data as this will already be set by SingleObjectMixin.get_context_data when subclassed.
@sdolemelipone
Copy link
Collaborator Author

Partly raised due to #165.

@codecov-io
Copy link

codecov-io commented Jun 1, 2018

Codecov Report

Merging #166 into master will decrease coverage by 0.55%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #166      +/-   ##
==========================================
- Coverage   53.34%   52.79%   -0.56%     
==========================================
  Files           6        6              
  Lines         508      483      -25     
  Branches       62       56       -6     
==========================================
- Hits          271      255      -16     
+ Misses        216      212       -4     
+ Partials       21       16       -5
Impacted Files Coverage Δ
extra_views/formsets.py 46.56% <0%> (-2.47%) ⬇️
extra_views/generic.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26195f3...bbd4f5d. Read the comment docs.

@jonashaag jonashaag merged commit e2e0ce6 into AndrewIngram:master Jun 2, 2018
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.

None yet

3 participants