Commit 3eabc2ee0187e28af08540993852b957abf21816
1 parent
291f42a6
poprawki w widoku wzorów
Showing
6 changed files
with
24 additions
and
7 deletions
README
... | ... | @@ -108,6 +108,10 @@ $ ./manage.py create_forms |
108 | 108 | |
109 | 109 | (trochę potrwa - rzędu kilkunastu minut, pod warunkiem, że baza jest zvacuumowana) |
110 | 110 | |
111 | +Należy też ustawić numery homonimów: | |
112 | + | |
113 | +# ./manage.py fix_homonym | |
114 | + | |
111 | 115 | |
112 | 116 | Odpalenie serwera |
113 | 117 | ----------------- |
... | ... |
dictionary/management/commands/import_data.py
... | ... | @@ -11,7 +11,7 @@ from dictionary.models import * |
11 | 11 | |
12 | 12 | DEFAULT_DATABASE = 'data/sgjp.db' |
13 | 13 | |
14 | -MINI_MODE = False # do debugowania | |
14 | +MINI_MODE = True # do debugowania | |
15 | 15 | MINI_LEXEME_COUNT = 500 |
16 | 16 | MINI_LEXEME_QUERY = 'SELECT %s FROM leksemy LIMIT ?' |
17 | 17 | |
... | ... | @@ -204,7 +204,7 @@ class ImportData(object): |
204 | 204 | ) |
205 | 205 | for row in result: |
206 | 206 | yield LexemeAssociation( |
207 | - vocabulary=vocab_table[row['slownik_uz']], lexeme__id=row['nr']) | |
207 | + vocabulary=vocab_table[row['slownik_uz']], lexeme_id=row['nr']) | |
208 | 208 | |
209 | 209 | def new_cross_reference_types(self): |
210 | 210 | result = self.sqlite_cursor.execute( |
... | ... | @@ -245,7 +245,7 @@ class ImportData(object): |
245 | 245 | if row['nrod'] and row['nrdo']: |
246 | 246 | cr_type = cr_type_table[(row['typods'], row['pos1'], row['pos2'])] |
247 | 247 | yield CrossReference( |
248 | - from_lexeme__id=row['nrod'], to_lexeme__id=row['nrdo'], | |
248 | + from_lexeme_id=row['nrod'], to_lexeme_id=row['nrdo'], | |
249 | 249 | type=cr_type) |
250 | 250 | |
251 | 251 | def import_pattern_types(self): |
... | ... | @@ -328,7 +328,7 @@ class ImportData(object): |
328 | 328 | for row in result: |
329 | 329 | if not SQL_MODE: |
330 | 330 | lip = LexemeInflectionPattern( |
331 | - lexeme__id=row['nr'], | |
331 | + lexeme_id=row['nr'], | |
332 | 332 | index=row['oskl'], |
333 | 333 | pattern=Pattern.objects.get(name=row['wzor']), |
334 | 334 | inflection_characteristic=self.ics[ |
... | ... | @@ -369,7 +369,7 @@ class ImportData(object): |
369 | 369 | 'pattern_type': PatternType.objects.get( |
370 | 370 | entry=row['typr'], lexical_class=lc), |
371 | 371 | 'inflection_characteristic': InflectionCharacteristic.objects.get( |
372 | - entry=row['charfl'], part_of_speech__symbol=row['pos']), | |
372 | + entry=row['charfl'], part_of_speech_symbol=row['pos']), | |
373 | 373 | } |
374 | 374 | tt, _created = TableTemplate.objects.get_or_create(**tt_data) |
375 | 375 | if not SQL_MODE: |
... | ... |
dictionary/models.py
... | ... | @@ -225,7 +225,7 @@ class Pattern(Model): |
225 | 225 | |
226 | 226 | # kiedyś trzeba zrobić porządek w nazwach. |
227 | 227 | name = CharField( |
228 | - max_length=32, unique=True, db_column='w_id', verbose_name=u'nazwa wzoru') | |
228 | + max_length=32, unique=True, db_column='w_id', verbose_name=u'nazwa') | |
229 | 229 | type = ForeignKey(PatternType, db_column='typ') |
230 | 230 | # rdzeń przykładowej formy hasłowej |
231 | 231 | example = CharField(max_length=64, db_column='przyklad', |
... | ... |
dictionary/templates/ending_row.html
dictionary/templates/pattern_edit_form.html
... | ... | @@ -2,7 +2,16 @@ |
2 | 2 | <p><input type="hidden" name="id" value="{{ id }}"/></p> |
3 | 3 | <div id="pattern-properties"> |
4 | 4 | {{ type_form.as_p }} |
5 | - {{ form.as_p }} | |
5 | + {% for field in form %} | |
6 | + {% if field.name != 'basic_form_ending' %} | |
7 | + <p class="main-field"> | |
8 | + {{ field.label_tag }} {{ field.as_widget }} | |
9 | + {% if field.name == 'example' %} | |
10 | + {{ form.basic_form_ending.as_widget }} | |
11 | + {% endif %} | |
12 | + </p> | |
13 | + {% endif %} | |
14 | + {% endfor %} | |
6 | 15 | <p class="pattern-save"> |
7 | 16 | <button type="submit" disabled="disabled" id="pattern-edit-submit"> |
8 | 17 | Zapisz |
... | ... |
dictionary/templates/pattern_view.html
... | ... | @@ -16,6 +16,9 @@ |
16 | 16 | <script type="text/javascript" src="{{ MEDIA_URL }}js/lib/cvi_busy_lib.js"></script> |
17 | 17 | <script type="text/javascript" src="{{ MEDIA_URL }}js/lib/splitter.js"></script> |
18 | 18 | <script type="text/javascript" src="{{ MEDIA_URL }}js/lib/jquery.multiselect.js"></script> |
19 | + <script type="text/javascript"> | |
20 | + $.fn.multiselect2 = $.fn.multiselect; | |
21 | + </script> | |
19 | 22 | <script type="text/javascript" src="{{ MEDIA_URL }}js/jqgrid-patch.js"></script> |
20 | 23 | <script type="text/javascript" src="{{ MEDIA_URL }}js/jqgrid.js"></script> |
21 | 24 | <script type="text/javascript" src="{{ MEDIA_URL }}js/pattern-view.js"></script> |
... | ... |