Open BCerki opened 1 month ago
@Sepehr-Sobhani would you like to add anything to this?
@Sepehr-Sobhani would you like to add anything to this?
We currently have this new method as a Django model method. We need to pass the model as the first argument. However, if we want to mirror the behavior of the built-in update_or_create
function, we need to add it to the model manager so that we can call it like Model.objects.custom_update_or_create(...)
.
Description of the Tech Debt
Django's update_or_create can't handle a None foreign key:
django.core.exceptions.ValidationError: {'id': ['This field cannot be null.']}
. We createdcustom_update_or_create
that can manage a None key (which is needed because anytime you create, the key is None), so this ticket is about replacing the update_or_create with the custom function.Tech Debt Triage
The purpose of our technical debt triage process is to analyze technical debt to determine risk level of the technical debt and the value in tackling that technical debt.
Risk Value Scoring: