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 | 3c8cf538438abbf9d9b9951ae4112f404f5c6bbd (patch) | |
tree | 72f513ef274a2ddb8eef5bfcb4ae2625cb7d08b2 /archaeological_files/models.py | |
parent | 013db4c21bf74a75f087e8d7ca8f6a334c3f3cba (diff) | |
download | Ishtar-3c8cf538438abbf9d9b9951ae4112f404f5c6bbd.tar.bz2 Ishtar-3c8cf538438abbf9d9b9951ae4112f404f5c6bbd.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: |