Skip to content

Commit

Permalink
By default, select DS dossier with Projet objects
Browse files Browse the repository at this point in the history
  • Loading branch information
tut-tuuut committed Nov 14, 2024
1 parent d9c25c9 commit 487c101
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gsl_projet/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def for_user(self, user: Collegue):
dossier_ds__ds_demarche__ds_instructeurs__ds_email=user.email
)

def get_queryset(self):
return super().get_queryset().select_related("dossier_ds")


class Projet(models.Model):
# demandeur = models.ForeignKey(Demandeur, on_delete=models.PROTECT)
Expand All @@ -34,7 +37,7 @@ class Projet(models.Model):
objects = ProjetManager()

def __str__(self):
return f"Projet {self.pk}"
return f"Projet {self.pk} — Dossier {self.dossier_ds.ds_number}"

@classmethod
def get_or_create_from_ds_dossier(cls, ds_dossier: Dossier):
Expand Down

0 comments on commit 487c101

Please sign in to comment.