GSOC 2023 Discussion and Feedback: Database-level Cascades

2023-03-27 Thread Akash Sen
Hello everyone, I’ve started this discussion to get feedback for my proposal for the project: Database-level Cascades Functionality to Django ORM. I have never contributed to any of the official Django projects earlier but I have experience using the framework for last 2 years. In this discuss

Re: GSOC 2023 Discussion and Feedback: Database-level Cascades

2023-03-29 Thread Akash Sen
sary `ON DELETE` clauses. Here's a demonstration of that: >>> https://github.com/shangxiao/stupid-django-tricks/tree/master/abusing_constraints#database-level-cascading-deletes >>> >>> The gist is: >>> >>>1. Set your fks to "do nothing&qu

Added support for Database Level Cascades

2023-05-13 Thread Akash Sen
*Added support for Database Level Cascades* *PR link *: https://github.com/django/django/pull/16851 *Ref discussion : * https://groups.google.com/g/django-developers/c/Sxj7eS7-8SQ/m/jaM1rPbZEQAJ *Approach :* The on_delete argument for ForeignKey class now supports an extra option DB_CASCADE thi

Re: Added support for Database Level Cascades

2023-05-14 Thread Akash Sen
one question, will this still trigger on delete signals for > cascaded models? > That's the main reason the cascade happens in Django and not in the > database. > > On Saturday, 13 May 2023 at 16:35:01 UTC+2 Akash Sen wrote: > >> *Added support for Database Level C

Ticket #30382 force_insert flag is not passed when saving parents on inherited models

2023-05-18 Thread Akash Sen
*Ticket link : *https://code.djangoproject.com/ticket/30382 *Problem : *When saving we pass force_insert=True to prevent the extra UPDATE statement that precedes the INSERT. The force_insert flag is respected on the child table but not on the parent. *The main problem : *On our first go this is

Ticket #30382 force_insert flag is not passed when saving parents on inherited models

2023-05-18 Thread Akash Sen
*[*Looking for an alternate approach*]* *Ticket link : *https://code.djangoproject.com/ticket/30382 *Problem : *When saving we pass force_insert=True to prevent the extra UPDATE statement that precedes the INSERT. The force_insert flag is respected on the child table but not on the parent. *The

Ticket #34634 : Creating objects with nested MTI crashes

2023-06-07 Thread Akash Sen
Ticket : https://code.djangoproject.com/ticket/34634 PR : https://github.com/django/django/pull/16952 *Possible reason behind the bug:* - The local OneToOneField of place_ptr inside ItalianRestaurantManyParents is being inherited from the place_ptr field of Restaurant. Which is one of

Re: Ticket #30382 force_insert flag is not passed when saving parents on inherited models

2023-06-08 Thread Akash Sen
h is coherent with the fact the >>> current leaf model must be inserted (current behavior) >>> - Complex MTI scenario forced insertion needs can be targeted with >>> specially crafted base tuples (think of diamond inheritance) >>> - If a deep ancestor must be ins

Looking for a code that separates fields while applying migrations

2023-09-30 Thread Akash Sen
Hello everyone, There are certain attributes in a field, after changing these the migration generated willbe applied to database, (for example take foreignkey) like null=True or db_default=1. As they have something to do with the database column. There are some other attributes after changing th

Re: Looking for a code that separates fields while applying migrations

2023-10-02 Thread Akash Sen
L’s > EnumField. > > On Sat, Sep 30, 2023, at 3:57 PM, Akash Sen wrote: > > Hello everyone, > There are certain attributes in a field, after changing these the > migration generated willbe applied to database, (for example take > foreignkey) like null=True or db_default=1.

Needed feedback on the approach to solve bulk_update silently truncating values for size limited fields

2023-10-16 Thread Akash Sen
Ticket#33647 : bulk_update silently truncating values for size limited fields *Approach 1:* As mentioned by Simon in this comment we can introduce a new argument maybe named generic in the dat

Re: Needed feedback on the approach to solve bulk_update silently truncating values for size limited fields

2023-10-16 Thread Akash Sen
/m/zZERk0MpAgAJ> > . > > I think that even if it requires a larger investment than adding a new > kwarg to Cast or have bulk_update call a new specialized bulk_update_cast > method on the backend instead of checking for the > requires_casted_case_in_updates > flag i

Re: Needed feedback on the approach to solve bulk_update silently truncating values for size limited fields

2023-10-16 Thread Akash Sen
Got it. Thank you for the response Mariusz and Simon. On Tuesday, October 17, 2023 at 11:43:00 AM UTC+5:30 Mariusz Felisiak wrote: > I wanted to propose these solution as a hotfix unless we get #31202 > or #29771 >