Commit ea232a86f8b1ec5d3f46084d786bdea24e546474
1 parent
81daac4e
filtrowanie wg źródła
--HG-- branch : beta
Showing
3 changed files
with
8 additions
and
1 deletions
README-DEV
@@ -3,6 +3,8 @@ dodawanie filtrów dla leksemów | @@ -3,6 +3,8 @@ dodawanie filtrów dla leksemów | ||
3 | 1. w js/lexeme-view.js dodajemy opis do filter_fields | 3 | 1. w js/lexeme-view.js dodajemy opis do filter_fields |
4 | [opcjonalnie: generować listę wartości w dictionary/views.py] | 4 | [opcjonalnie: generować listę wartości w dictionary/views.py] |
5 | 2. dodać tłumaczenie pola do LexemeQuery.filter_field_translation | 5 | 2. dodać tłumaczenie pola do LexemeQuery.filter_field_translation |
6 | + (jeśli tłumaczenie nie jest potrzebne, to trzeba dodać pole to | ||
7 | + LexemeQuery.literal_filter_fields) | ||
6 | 3. jeśli filtr potrzebuje specjalnej obsługi, to w LexemeQuery.apply_filter_rule | 8 | 3. jeśli filtr potrzebuje specjalnej obsługi, to w LexemeQuery.apply_filter_rule |
7 | 4. i już! | 9 | 4. i już! |
8 | 10 |
dictionary/ajax_lexeme_slickgrid.py
@@ -64,7 +64,7 @@ class LexemeQuery(SlickGridQuery): | @@ -64,7 +64,7 @@ class LexemeQuery(SlickGridQuery): | ||
64 | 64 | ||
65 | literal_filter_fields = [ | 65 | literal_filter_fields = [ |
66 | 'entry', 'part_of_speech', 'status', 'comment', 'qualifiers_dor', | 66 | 'entry', 'part_of_speech', 'status', 'comment', 'qualifiers_dor', |
67 | - 'gloss', 'note', 'extended_note', 'pronunciation', 'valence', | 67 | + 'gloss', 'note', 'extended_note', 'pronunciation', 'valence', 'source', |
68 | 'lexemeav__attribute_value_id', | 68 | 'lexemeav__attribute_value_id', |
69 | 'inflection__pronunciation', | 69 | 'inflection__pronunciation', |
70 | 'value', | 70 | 'value', |
dictionary/static/js/lexeme-view.js
@@ -237,6 +237,11 @@ $.extend(slickgrid, { | @@ -237,6 +237,11 @@ $.extend(slickgrid, { | ||
237 | gender: 'm', | 237 | gender: 'm', |
238 | ops: eqne, | 238 | ops: eqne, |
239 | options: $dj.user_options | 239 | options: $dj.user_options |
240 | + }, | ||
241 | + source: { | ||
242 | + name: gettext("Source"), | ||
243 | + gender: 'n', | ||
244 | + ops: text_ops | ||
240 | } | 245 | } |
241 | }, extra_attr_filter_fields), | 246 | }, extra_attr_filter_fields), |
242 | 247 |