diff options
| -rw-r--r-- | ishtar_common/forms_common.py | 2 | ||||
| -rw-r--r-- | ishtar_common/models.py | 4 | ||||
| -rw-r--r-- | ishtar_common/templates/blocks/DataTables.html | 2 | 
3 files changed, 7 insertions, 1 deletions
| diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 708e246b2..7b9f69237 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -408,6 +408,7 @@ class BaseOrganizationForm(forms.ModelForm):  class PersonSelect(TableSelect): +    search_vector = forms.CharField(label=_(u"Full text search"))      name = forms.CharField(label=_(u"Name"), max_length=200)      surname = forms.CharField(label=_(u"Surname"), max_length=50)      email = forms.CharField(label=_(u"Email"), max_length=75) @@ -520,6 +521,7 @@ class PersonUserSelect(PersonSelect):  class PersonUserFormSelection(PersonFormSelection): +    SEARCH = True      form_label = _(u"Person search")      associated_models = {'pk': models.Person}      currents = {'pk': models.Person} diff --git a/ishtar_common/models.py b/ishtar_common/models.py index aab532cfc..d81d9219e 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2246,6 +2246,7 @@ class Organization(Address, Merge, OwnPerms, ValueGetter):          'name': 'name__icontains',          'organization_type': 'organization_type__pk__in',      } +    BASE_SEARCH_VECTORS = ['name', 'town__name']      # fields      name = models.CharField(_(u"Name"), max_length=500) @@ -2332,6 +2333,8 @@ class Person(Address, Merge, OwnPerms, ValueGetter):                    'attached_to__name', 'town')      SHOW_URL = 'show-person'      MODIFY_URL = 'person_modify' +    BASE_SEARCH_VECTORS = ['name', 'surname', 'raw_name', 'town__name', +                           'attached_to__name', 'email']      # search parameters      REVERSED_BOOL_FIELDS = ['ishtaruser__isnull'] @@ -2339,6 +2342,7 @@ class Person(Address, Merge, OwnPerms, ValueGetter):          'name': ['name__icontains', 'raw_name__icontains'],          'surname': ['surname__icontains', 'raw_name__icontains'],          'attached_to': 'attached_to__pk', +        'attached_to__name': 'attached_to__name',          'person_types': 'person_types__pk__in',          'ishtaruser__isnull': 'ishtaruser__isnull'      } diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html index 81b61a86a..9133e4d05 100644 --- a/ishtar_common/templates/blocks/DataTables.html +++ b/ishtar_common/templates/blocks/DataTables.html @@ -33,7 +33,7 @@  </div>  <div id="grid_{{name}}_meta_wrapper"> -    <table id='grid_{{name}}' class="display"> +    <table id='grid_{{name}}' class="display" width="100%">          <thead>          <tr>              <th></th> | 
