diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2014-01-17 14:28:41 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2014-01-17 14:28:41 +0100 | 
| commit | b787f819a120cbc154867cb9ee02e5650b93e504 (patch) | |
| tree | 162945d752cf37ae82c874b6b4fba0ae804ad0f5 /archaeological_files/forms.py | |
| parent | e27550b8a4bed0dd60c34f6bc554a7be7fd88e10 (diff) | |
| download | Ishtar-b787f819a120cbc154867cb9ee02e5650b93e504.tar.bz2 Ishtar-b787f819a120cbc154867cb9ee02e5650b93e504.zip  | |
Improve administrativ act search (refs #1624)
Diffstat (limited to 'archaeological_files/forms.py')
| -rw-r--r-- | archaeological_files/forms.py | 23 | 
1 files changed, 23 insertions, 0 deletions
diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py index f65ee85c0..31badf4cb 100644 --- a/archaeological_files/forms.py +++ b/archaeological_files/forms.py @@ -220,6 +220,22 @@ class FinalFileDeleteForm(FinalForm):      confirm_msg = " "      confirm_end_msg = _(u"Would you like to delete this archaelogical file ?") +class AdministrativeActFileModifySelect(TableSelect): +    year = forms.IntegerField(label=_("Year")) +    index = forms.IntegerField(label=_("Index")) +    if settings.COUNTRY == 'fr': +        ref_sra = forms.CharField(label=u"Référence SRA", +                                  max_length=15) +    act_type = forms.ChoiceField(label=_("Act type"), choices=[]) +    operation__towns = get_town_field() + +    def __init__(self, *args, **kwargs): +        super(AdministrativeActFileModifySelect, self).__init__(*args, **kwargs) +        self.fields['act_type'].choices = ActType.get_types( +                                                   dct={'intented_to':'F'}) +        self.fields['act_type'].help_text = ActType.get_help( +                                                   dct={'intented_to':'F'}) +  class AdministrativeActFileSelect(TableSelect):      associated_file__towns = get_town_field()      act_type = forms.ChoiceField(label=_("Act type"), choices=[]) @@ -273,6 +289,13 @@ class AdministrativeActFileFormSelection(AdministrativeActOpeFormSelection):                        table_cols='TABLE_COLS_FILE'),         validators=[valid_id(AdministrativeAct)]) +class AdministrativeActFileModifyFormSelection(AdministrativeActOpeFormSelection): +    pk = forms.IntegerField(label="", required=False, +       widget=widgets.JQueryJqGrid(reverse_lazy('get-administrativeactfile'), +                      AdministrativeActFileModifySelect, AdministrativeAct, +                      table_cols='TABLE_COLS_FILE'), +       validators=[valid_id(AdministrativeAct)]) +  class AdministrativeActFileForm(AdministrativeActOpeForm):      act_type = forms.ChoiceField(label=_(u"Act type"), choices=[])  | 
