diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-07-07 11:12:16 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-07-08 09:59:31 +0200 |
commit | 1d3f7f13296636b2e1054cf31eb6b007f5e91c2b (patch) | |
tree | 72f513ef274a2ddb8eef5bfcb4ae2625cb7d08b2 /archaeological_files/models.py | |
parent | f690a78e56e903a12d76f67c5faf4661a63fc753 (diff) | |
download | Ishtar-1d3f7f13296636b2e1054cf31eb6b007f5e91c2b.tar.bz2 Ishtar-1d3f7f13296636b2e1054cf31eb6b007f5e91c2b.zip |
Preventive file form: filter jobs and equipements by price agreement
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r-- | archaeological_files/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 60f9882fe..829c8c550 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -126,11 +126,13 @@ class Job(GeneralType): return lbl @classmethod - def get_choices(cls, current_value): + def get_choices(cls, current_value, price_agreement_id=None): q = cls.objects.filter( available=True, parents__isnull=True, ) + if price_agreement_id: + q = q.filter(price_agreement=price_agreement_id) permanent = [(j.pk, str(j)) for j in q.filter(permanent_contract=True).all()] fixed_term = [(j.pk, str(j)) for j in q.filter(permanent_contract=False).all()] if current_value: |