Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

Mitchina
Copy link
Contributor

This patch is an update of @Parth1811 's closed PR.
It includes classes for FormSet, ModelFormSet, and InlineFormSet, allowing for the creation of formsets using a declarative syntax instead of a factory.

Parth1811 and others added 19 commits February 11, 2024 21:05
…nlineFormSet

This patch inlcude the classes FormSet, ModelFormSet and InlineFormSet from
which other class can be directly inherited to create a formset class instead of
using the default factory functions.
Added the references on how to create Formsets using the declarative syntax
which is an alternative method to using formset_factory functions
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello! Thank you for your contribution 💪

As it's your first contribution be sure to check out the patch review checklist.

If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!

If you have any design or process questions then you can ask in the Django forum.

Welcome aboard ⛵️!

@Parth1811
Copy link
Contributor

Thanks @Mitchina, for taking the time to work on this ancient PR.
I have lost the context for this, but the overall changes look promising to me.

docs/topics/forms/formsets.txt Outdated Show resolved Hide resolved
@Mitchina
Copy link
Contributor Author

Mitchina commented Mar 4, 2024

Thanks @Mitchina, for taking the time to work on this ancient PR. I have lost the context for this, but the overall changes look promising to me.

Hi @Parth1811, thank you for the encouragement! I'm glad to hear that you find the changes promising. Your changes and @carltongibson directions have been fundamental to me and I truly appreciate the opportunity to build upon them. I hope we can get it in!

@Mitchina Mitchina marked this pull request as ready for review March 4, 2024 00:11
Copy link
Contributor

@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

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

Hello @Mitchina 👋 thank you for being patient waiting for a review

I recommend that you squash these commits into one and add a commit message that is described in the committing guidelines.
It might make sense to turn this into a couple of commits and we might recommend to separate some stuff out later but for now, I think one commit is cleaner.

This is going to take quite a while to review and for us to work together to get it ready to merge. Just to manage your expectations, we already have a few PRs which have been in progress for quite some time that we are trying to push into 5.1 (the alpha freeze deadline is 22nd May). As this is unlikely to meet that deadline, we will aim to give this a more thorough review after the alpha freeze and hope to progress this for 5.2.

@@ -1,3 +1,5 @@
from typing import Any
Copy link
Contributor

Choose a reason for hiding this comment

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

Django is not using type annotations, please remove each of these ❤️

missing required argument and sets them to default values.
"""
if "form" not in set(attrs):
raise TypeError("FormSet() missing 1 required positional argument: 'form'.")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is missing a test

Comment on lines +1142 to +1149
def __init__(
self,
queryset=None,
):
"""Initialize ModelFormSet."""
super().__init__(
queryset,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def __init__(
self,
queryset=None,
):
"""Initialize ModelFormSet."""
super().__init__(
queryset,
)
def __init__(self, queryset=None):
super().__init__(queryset)

(nit)

Comment on lines +1463 to +1470
def __init__(
self,
instance=None,
):
"""Initialize ModelFormSet."""
super().__init__(
instance,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def __init__(
self,
instance=None,
):
"""Initialize ModelFormSet."""
super().__init__(
instance,
)
def __init__(self, instance=None):
super().__init__(instance)

"""Meta class for creating inlineformset using Declarative Syntax."""

def __new__(cls, name, bases, attrs):
"""Initialize the attributes given to the InlineFormSet class."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""Initialize the attributes given to the InlineFormSet class."""

I would say some of these comments are not needed as the code is self explanatory

sarahboyce pushed a commit to sai-ganesh-03/django that referenced this pull request Nov 11, 2024
Only users with view or change model permissions can access.
Thank you to Sarah Boyce for the review.
@knyghty
Copy link
Member

knyghty commented Nov 11, 2024

I was confused by this for a second, the Trac ID is the same as this PR number. Though not sure if this is still being worked on.

@knyghty knyghty reopened this Nov 11, 2024
ryancheley pushed a commit to ryancheley/django that referenced this pull request Nov 17, 2024
Only users with view or change model permissions can access.
Thank you to Sarah Boyce for the review.
gtossou pushed a commit to gtossou/django that referenced this pull request Apr 4, 2025
Only users with view or change model permissions can access.
Thank you to Sarah Boyce for the review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.