Intervention relations enhancements
* refactors model relation to compensation and payment by applying 1-n instead of n-n
This commit is contained in:
@@ -11,7 +11,6 @@ from django.db import transaction
|
||||
from django.utils import timezone
|
||||
from django.utils.timezone import now
|
||||
|
||||
from compensation.models import Payment, Compensation
|
||||
from intervention.settings import INTERVENTION_IDENTIFIER_LENGTH, INTERVENTION_IDENTIFIER_TEMPLATE
|
||||
from konova.models import BaseObject, Geometry
|
||||
from konova.utils.generators import generate_random_string
|
||||
@@ -51,8 +50,8 @@ class Intervention(BaseObject):
|
||||
next_version = models.ForeignKey("Intervention", null=True, blank=True, on_delete=models.DO_NOTHING)
|
||||
|
||||
# Compensation or payments, one-directional
|
||||
payments = models.ManyToManyField(Payment, related_name="+", blank=True)
|
||||
compensations = models.ManyToManyField(Compensation, related_name="+", blank=True)
|
||||
#payments = models.ManyToManyField(Payment, related_name="+", blank=True)
|
||||
#compensations = models.ManyToManyField(Compensation, related_name="+", blank=True)
|
||||
|
||||
# Users having access on this object
|
||||
users = models.ManyToManyField(User)
|
||||
|
||||
Reference in New Issue
Block a user