Request for closing #25139 -- ModelFormSet: allow swapping unique values

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Request for closing #25139 -- ModelFormSet: allow swapping unique values

PARTH PATIL
Hey can someone please have look at this ticket, I feel the requested feature is not really feasible to implement, also it's not applicable in the general case.

I don't think so this is feasible, this will require n(n-1)/2 comparisons to determine whether any two of the models are swapped.
This looks easy in the above case but won't be a good idea for a general case.

Correct me if I'm wrong or if anyone has a better approach for implementation of this feature. I would like to work on it.

But as of now, I feel this ticket should be closed


Here is a link to the ticket

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/61c73eca-c618-4c11-b5e6-6feaf407e8e6%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Request for closing #25139 -- ModelFormSet: allow swapping unique values

Carlton Gibson-3
Hi Parth. 

Thanks for looking at this. I think you're right that there's no (suitably obvious at least to me) simple way of solving this. I guess that's why it's sat there for 4 years. 🙂

What would it take: fetching the set of to_be_unique values and comparing it to the set of values submitted and then assigning both within a transaction... — meh, possible but I'm not sure it'd be clean, or something we'd want to bundle in even if we had the solution available, vs, putting it in a third-party package...

Anyhow, I'll bump it to Someday/Maybe for now. If someone pops up with a solution we can look at that then. 

Kind Regards,

Carlton


On Sunday, 11 August 2019 09:20:49 UTC+2, PARTH PATIL wrote:
Hey can someone please have look at this ticket, I feel the requested feature is not really feasible to implement, also it's not applicable in the general case.

I don't think so this is feasible, this will require n(n-1)/2 comparisons to determine whether any two of the models are swapped.
This looks easy in the above case but won't be a good idea for a general case.

Correct me if I'm wrong or if anyone has a better approach for implementation of this feature. I would like to work on it.

But as of now, I feel this ticket should be closed


Here is a link to the <a href="https://code.djangoproject.com/ticket/25139" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fcode.djangoproject.com%2Fticket%2F25139\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGr8VNPirEzaoDJTQuzd2pv547zGg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fcode.djangoproject.com%2Fticket%2F25139\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGr8VNPirEzaoDJTQuzd2pv547zGg&#39;;return true;">ticket

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/b0cce1d6-0f9d-44be-8c2f-a37a9f3755ed%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Request for closing #25139 -- ModelFormSet: allow swapping unique values

PARTH PATIL
Yup sounds right. 

On Thursday, August 15, 2019 at 3:13:23 PM UTC+5:30, Carlton Gibson wrote:
Hi Parth. 

Thanks for looking at this. I think you're right that there's no (suitably obvious at least to me) simple way of solving this. I guess that's why it's sat there for 4 years. 🙂

What would it take: fetching the set of to_be_unique values and comparing it to the set of values submitted and then assigning both within a transaction... — meh, possible but I'm not sure it'd be clean, or something we'd want to bundle in even if we had the solution available, vs, putting it in a third-party package...

Anyhow, I'll bump it to Someday/Maybe for now. If someone pops up with a solution we can look at that then. 

Kind Regards,

Carlton


On Sunday, 11 August 2019 09:20:49 UTC+2, PARTH PATIL wrote:
Hey can someone please have look at this ticket, I feel the requested feature is not really feasible to implement, also it's not applicable in the general case.

I don't think so this is feasible, this will require n(n-1)/2 comparisons to determine whether any two of the models are swapped.
This looks easy in the above case but won't be a good idea for a general case.

Correct me if I'm wrong or if anyone has a better approach for implementation of this feature. I would like to work on it.

But as of now, I feel this ticket should be closed


Here is a link to the <a href="https://code.djangoproject.com/ticket/25139" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fcode.djangoproject.com%2Fticket%2F25139\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGr8VNPirEzaoDJTQuzd2pv547zGg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fcode.djangoproject.com%2Fticket%2F25139\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGr8VNPirEzaoDJTQuzd2pv547zGg&#39;;return true;">ticket

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/7892adb1-908c-4cb3-b059-ba8454982f26%40googlegroups.com.