diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-01-30 19:19:38 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-01-30 19:19:38 +0100 |
commit | 929a879792864ae4d654796dc58315f876ac33fa (patch) | |
tree | ed0a68d93749184ad943bc17b650767cfe82a2e7 | |
parent | 1bd739ba7484a5ec62076071eaed65953673c5bc (diff) | |
download | Ishtar-929a879792864ae4d654796dc58315f876ac33fa.tar.bz2 Ishtar-929a879792864ae4d654796dc58315f876ac33fa.zip |
SRA Agent can be incharge of an operation (closes #145)
-rw-r--r-- | ishtar/furnitures/forms.py | 4 | ||||
-rw-r--r-- | ishtar/furnitures/views.py | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/ishtar/furnitures/forms.py b/ishtar/furnitures/forms.py index 1e9642072..a45c564af 100644 --- a/ishtar/furnitures/forms.py +++ b/ishtar/furnitures/forms.py @@ -1146,7 +1146,9 @@ class OperationFormGeneral(forms.Form): currents = {'associated_file':models.File} in_charge = forms.IntegerField(label=_("Person in charge of the operation"), widget=widgets.JQueryAutoComplete(reverse_lazy('autocomplete-person', - args=[models.PersonType.objects.get(txt_idx='head_scientist').pk]), + args=["_".join( + [unicode(models.PersonType.objects.get(txt_idx='head_scientist').pk), + unicode(models.PersonType.objects.get(txt_idx='sra_agent').pk)])]), associated_model=models.Person), validators=[models.valid_id(models.Person)]) associated_file = forms.IntegerField(label=_("Archaelogical file"), diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py index 041ebfb76..591ead231 100644 --- a/ishtar/furnitures/views.py +++ b/ishtar/furnitures/views.py @@ -70,6 +70,7 @@ def autocomplete_person(request, person_type=None): for q in q.split(' '): query = query & (Q(name__istartswith=q) | Q(surname__istartswith=q) | \ Q(email__icontains=q)) + print person_type if person_type: try: typs = [int(tp) for tp in person_type.split('_') if tp] |