Commit 61b1f67d0b65a36577288a605237b36889f58ff9
1 parent
849ba652
zmiana struktury szablonow tabel w bazie
Showing
5 changed files
with
534 additions
and
59 deletions
dictionary/ajax_table_view.py
... | ... | @@ -20,33 +20,34 @@ def table_edit_form(request, template_id): |
20 | 20 | bfls = BaseFormLabel.objects.none() |
21 | 21 | for pt in p_types: |
22 | 22 | bfls |= pt.base_form_labels() |
23 | - cells = tt.cells.prefetch_related( | |
24 | - 'table_cells__pattern_types', 'table_cells__inflection_characteristics', | |
25 | - 'export_cells__pattern_types', | |
26 | - 'export_cells__inflection_characteristics') | |
27 | - for cell in cells: | |
28 | - for tc in cell.table_cells.all(): | |
29 | - prefix = u'tc%s' % tc.id | |
30 | - bfl_form = BaseFormLabelForm( | |
31 | - bfls, cell.base_form_label_id, prefix=prefix) | |
32 | - form_rows.append(( | |
33 | - (tc.row, tc.col, tc.rowspan, tc.colspan, tc.index), | |
34 | - ('table', bfl_form, cell.prefix, cell.suffix), | |
35 | - CellRestrictionsForm( | |
36 | - tc.pattern_types.all(), p_types, | |
37 | - tc.inflection_characteristics.all(), ics, prefix=prefix), | |
38 | - )) | |
39 | - for ec in cell.export_cells.all(): | |
40 | - prefix = u'ec%s' % ec.id | |
41 | - bfl_form = BaseFormLabelForm( | |
42 | - bfls, cell.base_form_label_id, prefix=prefix) | |
43 | - form_rows.append(( | |
44 | - ec.tag_template, | |
45 | - ('export', bfl_form, cell.prefix, cell.suffix), | |
46 | - CellRestrictionsForm( | |
47 | - ec.pattern_types.all(), p_types, | |
48 | - ec.inflection_characteristics.all(), ics, prefix=prefix), | |
49 | - )) | |
23 | + table_cells = tt.table_cells.prefetch_related( | |
24 | + 'pattern_types', 'inflection_characteristics') | |
25 | + export_cells = tt.export_cells.prefetch_related( | |
26 | + 'pattern_types', 'inflection_characteristics').select_related( | |
27 | + 'base_form_label') | |
28 | + for tc in table_cells: | |
29 | + prefix = u'tc%s' % tc.id | |
30 | + bfl_form = BaseFormLabelForm( | |
31 | + bfls, tc.base_form_label_id, prefix=prefix) | |
32 | + form_rows.append(( | |
33 | + (tc.row, tc.col, tc.rowspan, tc.colspan, tc.index), | |
34 | + ('table', bfl_form, tc.prefix, tc.suffix), | |
35 | + CellRestrictionsForm( | |
36 | + tc.pattern_types.all(), p_types, | |
37 | + tc.inflection_characteristics.all(), ics, prefix=prefix), | |
38 | + )) | |
39 | + for ec in export_cells: | |
40 | + prefix = u'ec%s' % ec.id | |
41 | + bfl_form = BaseFormLabelForm( | |
42 | + bfls, ec.base_form_label_id, prefix=prefix) | |
43 | + form_rows.append(( | |
44 | + ec.tag_template, | |
45 | + ('export', bfl_form, ec.prefix, ec.suffix), | |
46 | + CellRestrictionsForm( | |
47 | + ec.pattern_types.all(), p_types, | |
48 | + ec.inflection_characteristics.all(), ics, prefix=prefix), | |
49 | + ec.base_form_label.symbol, | |
50 | + )) | |
50 | 51 | |
51 | 52 | headers = tt.headers.prefetch_related( |
52 | 53 | 'pattern_types', 'inflection_characteristics') |
... | ... | @@ -61,7 +62,11 @@ def table_edit_form(request, template_id): |
61 | 62 | header.pattern_types.all(), p_types, |
62 | 63 | header.inflection_characteristics.all(), ics, prefix=prefix) |
63 | 64 | )) |
64 | - return {'form_rows': sorted(form_rows), 'color_scheme': color_scheme} | |
65 | + if export_cells: | |
66 | + form_rows.sort(key=lambda row: (row[3], row[0], row[1][2:])) | |
67 | + else: | |
68 | + form_rows.sort() | |
69 | + return {'form_rows': form_rows, 'color_scheme': color_scheme} | |
65 | 70 | |
66 | 71 | @render_ajax(template='template_preview_form.html', method='get') |
67 | 72 | def template_preview_form(request, template_id): |
... | ... |
dictionary/management/commands/convert_tables.py
1 | 1 | # -*- coding: utf-8 -*- |
2 | 2 | from django.core.management import BaseCommand |
3 | 3 | from common.util import GroupDict |
4 | -from dictionary.models import Cell, NewTableTemplate, LexicalClass, PatternType, NewCell, TableTemplate, NewTableCell, TableHeader, NewTableHeader, LexemeAttribute, NewExportCell | |
4 | +from dictionary.models import Cell, NewTableTemplate, LexicalClass, \ | |
5 | + PatternType, TableTemplate, NewTableCell, TableHeader, \ | |
6 | + NewTableHeader, LexemeAttribute, NewExportCell | |
5 | 7 | |
6 | 8 | |
7 | 9 | class Command(BaseCommand): |
... | ... | @@ -165,10 +167,9 @@ def convert_table_cells(cell_group, new_cell): |
165 | 167 | templates = TableTemplate.objects.filter(cell__in=table_group) |
166 | 168 | for ics, pts in rectangles(templates).iteritems(): |
167 | 169 | new_table_cell = NewTableCell( |
168 | - cell=new_cell, | |
169 | 170 | row=table_key[0], col=table_key[1], |
170 | 171 | rowspan=table_key[2], colspan=table_key[3], |
171 | - index=table_key[4]) | |
172 | + index=table_key[4], **new_cell) | |
172 | 173 | new_table_cell.save() |
173 | 174 | for ic in ics: |
174 | 175 | new_table_cell.inflection_characteristics.add(ic) #add |
... | ... | @@ -196,7 +197,7 @@ def convert_export_cells(cell_group, new_cell): |
196 | 197 | templates = TableTemplate.objects.filter(cell__in=export_group) |
197 | 198 | for ics, pts in rectangles(templates).iteritems(): |
198 | 199 | new_export_cell = NewExportCell( |
199 | - cell=new_cell, tag_template=tag_template) | |
200 | + tag_template=tag_template, **new_cell) | |
200 | 201 | new_export_cell.save() |
201 | 202 | for ic in ics: |
202 | 203 | new_export_cell.inflection_characteristics.add(ic) #add |
... | ... | @@ -211,10 +212,12 @@ def convert_cells(cells, new_template, variant): |
211 | 212 | (cell.prefix, cell.base_form_label, cell.suffix), cell) |
212 | 213 | for key, cell_group in cell_groups.iteritems(): |
213 | 214 | #print key[1] |
214 | - new_cell = NewCell( | |
215 | - table_template=new_template, base_form_label=key[1], | |
216 | - prefix=key[0], suffix=key[2]) | |
217 | - new_cell.save() | |
215 | + new_cell = { | |
216 | + 'table_template': new_template, | |
217 | + 'base_form_label': key[1], | |
218 | + 'prefix': key[0], | |
219 | + 'suffix': key[2] | |
220 | + } | |
218 | 221 | if variant in TABLE_VARIANTS: |
219 | 222 | convert_table_cells(cell_group, new_cell) |
220 | 223 | else: |
... | ... |
dictionary/migrations/0040_auto__del_newcell__del_field_newtablecell_cell__add_field_newtablecell.py
0 → 100644
1 | +# -*- coding: utf-8 -*- | |
2 | +import datetime | |
3 | +from south.db import db | |
4 | +from south.v2 import SchemaMigration | |
5 | +from django.db import models | |
6 | + | |
7 | + | |
8 | +class Migration(SchemaMigration): | |
9 | + | |
10 | + def forwards(self, orm): | |
11 | + # Deleting model 'NewCell' | |
12 | + db.delete_table(u'dictionary_newcell') | |
13 | + | |
14 | + # Deleting field 'NewTableCell.cell' | |
15 | + db.delete_column(u'dictionary_newtablecell', 'cell_id') | |
16 | + | |
17 | + # Adding field 'NewTableCell.base_form_label' | |
18 | + db.add_column(u'dictionary_newtablecell', 'base_form_label', | |
19 | + self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['dictionary.BaseFormLabel']), | |
20 | + keep_default=False) | |
21 | + | |
22 | + # Adding field 'NewTableCell.prefix' | |
23 | + db.add_column(u'dictionary_newtablecell', 'prefix', | |
24 | + self.gf('django.db.models.fields.CharField')(default='', max_length=20, blank=True), | |
25 | + keep_default=False) | |
26 | + | |
27 | + # Adding field 'NewTableCell.suffix' | |
28 | + db.add_column(u'dictionary_newtablecell', 'suffix', | |
29 | + self.gf('django.db.models.fields.CharField')(default='', max_length=20, blank=True), | |
30 | + keep_default=False) | |
31 | + | |
32 | + # Adding field 'NewTableCell.table_template' | |
33 | + db.add_column(u'dictionary_newtablecell', 'table_template', | |
34 | + self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='table_cells', to=orm['dictionary.NewTableTemplate']), | |
35 | + keep_default=False) | |
36 | + | |
37 | + # Deleting field 'NewExportCell.cell' | |
38 | + db.delete_column(u'dictionary_newexportcell', 'cell_id') | |
39 | + | |
40 | + # Adding field 'NewExportCell.base_form_label' | |
41 | + db.add_column(u'dictionary_newexportcell', 'base_form_label', | |
42 | + self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['dictionary.BaseFormLabel']), | |
43 | + keep_default=False) | |
44 | + | |
45 | + # Adding field 'NewExportCell.prefix' | |
46 | + db.add_column(u'dictionary_newexportcell', 'prefix', | |
47 | + self.gf('django.db.models.fields.CharField')(default='', max_length=20, blank=True), | |
48 | + keep_default=False) | |
49 | + | |
50 | + # Adding field 'NewExportCell.suffix' | |
51 | + db.add_column(u'dictionary_newexportcell', 'suffix', | |
52 | + self.gf('django.db.models.fields.CharField')(default='', max_length=20, blank=True), | |
53 | + keep_default=False) | |
54 | + | |
55 | + # Adding field 'NewExportCell.table_template' | |
56 | + db.add_column(u'dictionary_newexportcell', 'table_template', | |
57 | + self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='export_cells', to=orm['dictionary.NewTableTemplate']), | |
58 | + keep_default=False) | |
59 | + | |
60 | + | |
61 | + def backwards(self, orm): | |
62 | + # Adding model 'NewCell' | |
63 | + db.create_table(u'dictionary_newcell', ( | |
64 | + ('suffix', self.gf('django.db.models.fields.CharField')(max_length=20, blank=True)), | |
65 | + ('base_form_label', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['dictionary.BaseFormLabel'])), | |
66 | + ('prefix', self.gf('django.db.models.fields.CharField')(max_length=20, blank=True)), | |
67 | + ('table_template', self.gf('django.db.models.fields.related.ForeignKey')(related_name='cells', to=orm['dictionary.NewTableTemplate'])), | |
68 | + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), | |
69 | + )) | |
70 | + db.send_create_signal(u'dictionary', ['NewCell']) | |
71 | + | |
72 | + | |
73 | + # User chose to not deal with backwards NULL issues for 'NewTableCell.cell' | |
74 | + raise RuntimeError("Cannot reverse this migration. 'NewTableCell.cell' and its values cannot be restored.") | |
75 | + # Deleting field 'NewTableCell.base_form_label' | |
76 | + db.delete_column(u'dictionary_newtablecell', 'base_form_label_id') | |
77 | + | |
78 | + # Deleting field 'NewTableCell.prefix' | |
79 | + db.delete_column(u'dictionary_newtablecell', 'prefix') | |
80 | + | |
81 | + # Deleting field 'NewTableCell.suffix' | |
82 | + db.delete_column(u'dictionary_newtablecell', 'suffix') | |
83 | + | |
84 | + # Deleting field 'NewTableCell.table_template' | |
85 | + db.delete_column(u'dictionary_newtablecell', 'table_template_id') | |
86 | + | |
87 | + | |
88 | + # User chose to not deal with backwards NULL issues for 'NewExportCell.cell' | |
89 | + raise RuntimeError("Cannot reverse this migration. 'NewExportCell.cell' and its values cannot be restored.") | |
90 | + # Deleting field 'NewExportCell.base_form_label' | |
91 | + db.delete_column(u'dictionary_newexportcell', 'base_form_label_id') | |
92 | + | |
93 | + # Deleting field 'NewExportCell.prefix' | |
94 | + db.delete_column(u'dictionary_newexportcell', 'prefix') | |
95 | + | |
96 | + # Deleting field 'NewExportCell.suffix' | |
97 | + db.delete_column(u'dictionary_newexportcell', 'suffix') | |
98 | + | |
99 | + # Deleting field 'NewExportCell.table_template' | |
100 | + db.delete_column(u'dictionary_newexportcell', 'table_template_id') | |
101 | + | |
102 | + | |
103 | + models = { | |
104 | + u'auth.group': { | |
105 | + 'Meta': {'object_name': 'Group'}, | |
106 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
107 | + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), | |
108 | + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) | |
109 | + }, | |
110 | + u'auth.permission': { | |
111 | + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, | |
112 | + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | |
113 | + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), | |
114 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
115 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | |
116 | + }, | |
117 | + u'auth.user': { | |
118 | + 'Meta': {'object_name': 'User'}, | |
119 | + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | |
120 | + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), | |
121 | + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | |
122 | + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), | |
123 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
124 | + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | |
125 | + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | |
126 | + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | |
127 | + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | |
128 | + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | |
129 | + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), | |
130 | + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), | |
131 | + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) | |
132 | + }, | |
133 | + u'contenttypes.contenttype': { | |
134 | + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, | |
135 | + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | |
136 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
137 | + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | |
138 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) | |
139 | + }, | |
140 | + u'dictionary.baseformlabel': { | |
141 | + 'Meta': {'object_name': 'BaseFormLabel', 'db_table': "'efobazy'"}, | |
142 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
143 | + 'symbol': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_column': "'efobaz'", 'blank': 'True'}) | |
144 | + }, | |
145 | + u'dictionary.cell': { | |
146 | + 'Meta': {'ordering': "['index']", 'object_name': 'Cell', 'db_table': "'klatki'"}, | |
147 | + 'base_form_label': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.BaseFormLabel']", 'db_column': "'efobaz'"}), | |
148 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
149 | + 'index': ('django.db.models.fields.IntegerField', [], {'db_column': "'kind'"}), | |
150 | + 'prefix': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_column': "'prefiks'", 'blank': 'True'}), | |
151 | + 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_column': "'sufiks'", 'blank': 'True'}), | |
152 | + 'table_template': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.TableTemplate']", 'db_column': "'st_id'"}), | |
153 | + 'tag': ('django.db.models.fields.TextField', [], {'db_column': "'tag'", 'blank': 'True'}) | |
154 | + }, | |
155 | + u'dictionary.classification': { | |
156 | + 'Meta': {'object_name': 'Classification', 'db_table': "'klasyfikacje'"}, | |
157 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
158 | + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_column': "'nazwa'"}), | |
159 | + 'parts_of_speech': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.PartOfSpeech']", 'symmetrical': 'False'}) | |
160 | + }, | |
161 | + u'dictionary.classificationvalue': { | |
162 | + 'Meta': {'object_name': 'ClassificationValue', 'db_table': "'wartosci_klasyfikacji'"}, | |
163 | + 'classification': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'values'", 'db_column': "'klas_id'", 'to': u"orm['dictionary.Classification']"}), | |
164 | + 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'usunieta'"}), | |
165 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
166 | + 'label': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_column': "'nazwa'"}), | |
167 | + 'lexemes': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.Lexeme']", 'symmetrical': 'False', 'through': u"orm['dictionary.LexemeCV']", 'blank': 'True'}), | |
168 | + 'parent_node': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'child_nodes'", 'null': 'True', 'db_column': "'rodzic'", 'to': u"orm['dictionary.ClassificationValue']"}) | |
169 | + }, | |
170 | + u'dictionary.crossreference': { | |
171 | + 'Meta': {'object_name': 'CrossReference', 'db_table': "'odsylacze'"}, | |
172 | + 'from_lexeme': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'refs_to'", 'db_column': "'l_id_od'", 'to': u"orm['dictionary.Lexeme']"}), | |
173 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
174 | + 'to_lexeme': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'refs_from'", 'db_column': "'l_id_do'", 'to': u"orm['dictionary.Lexeme']"}), | |
175 | + 'type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.CrossReferenceType']", 'db_column': "'typods_id'"}) | |
176 | + }, | |
177 | + u'dictionary.crossreferencetype': { | |
178 | + 'Meta': {'object_name': 'CrossReferenceType', 'db_table': "'typyodsylaczy'"}, | |
179 | + 'desc': ('django.db.models.fields.CharField', [], {'max_length': '40', 'db_column': "'naglowek'"}), | |
180 | + 'from_pos': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'crtype_to'", 'db_column': "'pos1'", 'to': u"orm['dictionary.PartOfSpeech']"}), | |
181 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
182 | + 'index': ('django.db.models.fields.IntegerField', [], {'db_column': "'kolejnosc'"}), | |
183 | + 'symbol': ('django.db.models.fields.CharField', [], {'max_length': '10', 'db_column': "'typods'"}), | |
184 | + 'to_pos': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'crtype_from'", 'db_column': "'pos2'", 'to': u"orm['dictionary.PartOfSpeech']"}) | |
185 | + }, | |
186 | + u'dictionary.ending': { | |
187 | + 'Meta': {'ordering': "['index']", 'unique_together': "(('pattern', 'base_form_label', 'index'),)", 'object_name': 'Ending', 'db_table': "'zakonczenia'"}, | |
188 | + 'base_form_label': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.BaseFormLabel']", 'db_column': "'efobaz'"}), | |
189 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
190 | + 'index': ('django.db.models.fields.IntegerField', [], {'db_column': "'zind'"}), | |
191 | + 'pattern': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'endings'", 'db_column': "'w_id'", 'to': u"orm['dictionary.Pattern']"}), | |
192 | + 'qualifiers': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.Qualifier']", 'symmetrical': 'False', 'db_table': "'kwalifikatory_zakonczen'", 'blank': 'True'}), | |
193 | + 'string': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_column': "'zak'", 'blank': 'True'}) | |
194 | + }, | |
195 | + u'dictionary.history': { | |
196 | + 'Meta': {'object_name': 'History', 'db_table': "'history'"}, | |
197 | + 'column_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_column': "'column_name_'", 'blank': 'True'}), | |
198 | + 'column_ord': ('django.db.models.fields.IntegerField', [], {'db_column': "'ordinal_position_of_column_'"}), | |
199 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
200 | + 'lexeme': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Lexeme']", 'null': 'True', 'db_column': "'lexeme_id_'", 'blank': 'True'}), | |
201 | + 'new_value': ('django.db.models.fields.TextField', [], {'db_column': "'new_value_'", 'blank': 'True'}), | |
202 | + 'old_value': ('django.db.models.fields.TextField', [], {'db_column': "'old_value_'", 'blank': 'True'}), | |
203 | + 'operation': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_column': "'operation_'"}), | |
204 | + 'pattern': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Pattern']", 'null': 'True', 'db_column': "'pattern_id_'", 'blank': 'True'}), | |
205 | + 'row_id': ('django.db.models.fields.IntegerField', [], {'db_column': "'id_'"}), | |
206 | + 'table_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_column': "'table_name_'"}), | |
207 | + 'table_oid': ('django.db.models.fields.IntegerField', [], {'db_column': "'table_oid_'"}), | |
208 | + 'timestamp': ('django.db.models.fields.DateTimeField', [], {'db_column': "'timestamp_'"}), | |
209 | + 'transaction_began': ('django.db.models.fields.DateTimeField', [], {'db_column': "'transaction_began_'"}), | |
210 | + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'db_column': "'user_id_'"}) | |
211 | + }, | |
212 | + u'dictionary.inflectioncharacteristic': { | |
213 | + 'Meta': {'unique_together': "(('symbol', 'part_of_speech'),)", 'object_name': 'InflectionCharacteristic', 'db_table': "'charfle'"}, | |
214 | + 'basic_form_label': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.BaseFormLabel']", 'db_column': "'efobaz'"}), | |
215 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
216 | + 'part_of_speech': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.PartOfSpeech']", 'db_column': "'pos'"}), | |
217 | + 'symbol': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_column': "'charfl'", 'blank': 'True'}) | |
218 | + }, | |
219 | + u'dictionary.inputform': { | |
220 | + 'Meta': {'object_name': 'InputForm'}, | |
221 | + 'form': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), | |
222 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
223 | + 'input_lexeme': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.InputLexeme']"}) | |
224 | + }, | |
225 | + u'dictionary.inputlexeme': { | |
226 | + 'Meta': {'object_name': 'InputLexeme'}, | |
227 | + 'entry': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), | |
228 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) | |
229 | + }, | |
230 | + u'dictionary.lexeme': { | |
231 | + 'Meta': {'object_name': 'Lexeme', 'db_table': "'leksemy'"}, | |
232 | + 'comment': ('django.db.models.fields.TextField', [], {'db_column': "'komentarz'", 'blank': 'True'}), | |
233 | + 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'usuniety'"}), | |
234 | + 'entry': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'db_column': "'haslo'", 'blank': 'True'}), | |
235 | + 'entry_suffix': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_column': "'haslosuf'", 'blank': 'True'}), | |
236 | + 'gloss': ('django.db.models.fields.TextField', [], {'db_column': "'glosa'", 'blank': 'True'}), | |
237 | + 'homonym_number': ('django.db.models.fields.IntegerField', [], {'default': '1', 'db_column': "'hom'"}), | |
238 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
239 | + 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_column': "'data_modyfikacji'", 'blank': 'True'}), | |
240 | + 'note': ('django.db.models.fields.TextField', [], {'db_column': "'nota'", 'blank': 'True'}), | |
241 | + 'owner_vocabulary': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owned_lexemes'", 'db_column': "'slownik'", 'to': u"orm['dictionary.Vocabulary']"}), | |
242 | + 'part_of_speech': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.PartOfSpeech']", 'db_column': "'pos'"}), | |
243 | + 'patterns': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.Pattern']", 'through': u"orm['dictionary.LexemeInflectionPattern']", 'symmetrical': 'False'}), | |
244 | + 'pronunciation': ('django.db.models.fields.TextField', [], {'db_column': "'wymowa'", 'blank': 'True'}), | |
245 | + 'qualifiers': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.Qualifier']", 'symmetrical': 'False', 'db_table': "'kwalifikatory_leksemow'", 'blank': 'True'}), | |
246 | + 'responsible': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'db_column': "'odpowiedzialny'", 'blank': 'True'}), | |
247 | + 'source': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_column': "'zrodlo'", 'blank': 'True'}), | |
248 | + 'status': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_column': "'status'"}), | |
249 | + 'valence': ('django.db.models.fields.TextField', [], {'blank': 'True'}) | |
250 | + }, | |
251 | + u'dictionary.lexemeassociation': { | |
252 | + 'Meta': {'unique_together': "(['lexeme', 'vocabulary'],)", 'object_name': 'LexemeAssociation', 'db_table': "'leksemy_w_slownikach'"}, | |
253 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
254 | + 'lexeme': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Lexeme']", 'db_column': "'l_id'"}), | |
255 | + 'vocabulary': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Vocabulary']", 'db_column': "'slownik'"}) | |
256 | + }, | |
257 | + u'dictionary.lexemeattribute': { | |
258 | + 'Meta': {'object_name': 'LexemeAttribute'}, | |
259 | + 'closed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | |
260 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
261 | + 'inflection_characteristics': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.InflectionCharacteristic']", 'symmetrical': 'False', 'blank': 'True'}), | |
262 | + 'multiple': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | |
263 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '32'}), | |
264 | + 'parts_of_speech': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.PartOfSpeech']", 'symmetrical': 'False'}), | |
265 | + 'required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | |
266 | + 'takes_ic': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) | |
267 | + }, | |
268 | + u'dictionary.lexemeattributevalue': { | |
269 | + 'Meta': {'ordering': "['value']", 'object_name': 'LexemeAttributeValue'}, | |
270 | + 'attribute': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'values'", 'to': u"orm['dictionary.LexemeAttribute']"}), | |
271 | + 'display_value': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}), | |
272 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
273 | + 'lexemes': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.Lexeme']", 'symmetrical': 'False', 'through': u"orm['dictionary.LexemeAV']", 'blank': 'True'}), | |
274 | + 'value': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}) | |
275 | + }, | |
276 | + u'dictionary.lexemeav': { | |
277 | + 'Meta': {'unique_together': "(['lexeme', 'attribute_value'],)", 'object_name': 'LexemeAV'}, | |
278 | + 'attribute_value': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.LexemeAttributeValue']"}), | |
279 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
280 | + 'lexeme': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Lexeme']"}) | |
281 | + }, | |
282 | + u'dictionary.lexemecv': { | |
283 | + 'Meta': {'unique_together': "(['lexeme', 'classification_value'],)", 'object_name': 'LexemeCV'}, | |
284 | + 'classification_value': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.ClassificationValue']"}), | |
285 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
286 | + 'lexeme': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Lexeme']"}) | |
287 | + }, | |
288 | + u'dictionary.lexemeform': { | |
289 | + 'Meta': {'object_name': 'LexemeForm'}, | |
290 | + 'form': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), | |
291 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
292 | + 'lexeme': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Lexeme']"}) | |
293 | + }, | |
294 | + u'dictionary.lexemeinflectionpattern': { | |
295 | + 'Meta': {'ordering': "['index']", 'unique_together': "(('lexeme', 'index'),)", 'object_name': 'LexemeInflectionPattern', 'db_table': "'odmieniasie'"}, | |
296 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
297 | + 'index': ('django.db.models.fields.IntegerField', [], {'db_column': "'oind'"}), | |
298 | + 'inflection_characteristic': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.InflectionCharacteristic']", 'db_column': "'charfl'"}), | |
299 | + 'lexeme': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Lexeme']", 'db_column': "'l_id'"}), | |
300 | + 'pattern': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Pattern']", 'db_column': "'w_id'"}), | |
301 | + 'qualifiers': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.Qualifier']", 'symmetrical': 'False', 'db_table': "'kwalifikatory_odmieniasiow'", 'blank': 'True'}), | |
302 | + 'root': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_column': "'rdzen'"}) | |
303 | + }, | |
304 | + u'dictionary.lexicalclass': { | |
305 | + 'Meta': {'object_name': 'LexicalClass', 'db_table': "'czescimowy'"}, | |
306 | + 'symbol': ('django.db.models.fields.CharField', [], {'max_length': '16', 'primary_key': 'True', 'db_column': "'czm'"}) | |
307 | + }, | |
308 | + u'dictionary.newexportcell': { | |
309 | + 'Meta': {'object_name': 'NewExportCell'}, | |
310 | + 'base_form_label': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.BaseFormLabel']"}), | |
311 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
312 | + 'inflection_characteristics': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.InflectionCharacteristic']", 'symmetrical': 'False'}), | |
313 | + 'pattern_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.PatternType']", 'symmetrical': 'False'}), | |
314 | + 'prefix': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), | |
315 | + 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), | |
316 | + 'table_template': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'export_cells'", 'to': u"orm['dictionary.NewTableTemplate']"}), | |
317 | + 'tag_template': ('django.db.models.fields.TextField', [], {}) | |
318 | + }, | |
319 | + u'dictionary.newtablecell': { | |
320 | + 'Meta': {'object_name': 'NewTableCell'}, | |
321 | + 'base_form_label': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.BaseFormLabel']"}), | |
322 | + 'col': ('django.db.models.fields.IntegerField', [], {}), | |
323 | + 'colspan': ('django.db.models.fields.IntegerField', [], {}), | |
324 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
325 | + 'index': ('django.db.models.fields.IntegerField', [], {}), | |
326 | + 'inflection_characteristics': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.InflectionCharacteristic']", 'symmetrical': 'False'}), | |
327 | + 'pattern_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.PatternType']", 'symmetrical': 'False'}), | |
328 | + 'prefix': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), | |
329 | + 'row': ('django.db.models.fields.IntegerField', [], {}), | |
330 | + 'rowspan': ('django.db.models.fields.IntegerField', [], {}), | |
331 | + 'suffix': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), | |
332 | + 'table_template': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'table_cells'", 'to': u"orm['dictionary.NewTableTemplate']"}) | |
333 | + }, | |
334 | + u'dictionary.newtableheader': { | |
335 | + 'Meta': {'object_name': 'NewTableHeader'}, | |
336 | + 'attribute_values': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.LexemeAttributeValue']", 'symmetrical': 'False'}), | |
337 | + 'attributes': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.LexemeAttribute']", 'symmetrical': 'False'}), | |
338 | + 'col': ('django.db.models.fields.IntegerField', [], {}), | |
339 | + 'colspan': ('django.db.models.fields.IntegerField', [], {}), | |
340 | + 'css_class': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_column': "'styl'"}), | |
341 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
342 | + 'inflection_characteristics': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.InflectionCharacteristic']", 'symmetrical': 'False'}), | |
343 | + 'label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_column': "'nagl'", 'blank': 'True'}), | |
344 | + 'pattern_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.PatternType']", 'symmetrical': 'False'}), | |
345 | + 'row': ('django.db.models.fields.IntegerField', [], {}), | |
346 | + 'rowspan': ('django.db.models.fields.IntegerField', [], {}), | |
347 | + 'table_template': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'headers'", 'to': u"orm['dictionary.NewTableTemplate']"}) | |
348 | + }, | |
349 | + u'dictionary.newtabletemplate': { | |
350 | + 'Meta': {'object_name': 'NewTableTemplate'}, | |
351 | + 'attribute_values': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.LexemeAttributeValue']", 'symmetrical': 'False'}), | |
352 | + 'attributes': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.LexemeAttribute']", 'symmetrical': 'False'}), | |
353 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
354 | + 'name': ('django.db.models.fields.TextField', [], {}), | |
355 | + 'parts_of_speech': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.PartOfSpeech']", 'symmetrical': 'False'}), | |
356 | + 'pattern_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['dictionary.PatternType']", 'symmetrical': 'False'}), | |
357 | + 'variant': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Variant']"}) | |
358 | + }, | |
359 | + u'dictionary.paradygmatywsjp': { | |
360 | + 'Meta': {'object_name': 'ParadygmatyWSJP', 'db_table': "'paradygmatywsjp'"}, | |
361 | + 'charfl': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.InflectionCharacteristic']", 'db_column': "'charfl'"}), | |
362 | + 'col': ('django.db.models.fields.IntegerField', [], {}), | |
363 | + 'colspan': ('django.db.models.fields.IntegerField', [], {}), | |
364 | + 'efobaz': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.BaseFormLabel']", 'db_column': "'efobaz'"}), | |
365 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
366 | + 'kskl': ('django.db.models.fields.IntegerField', [], {}), | |
367 | + 'morf': ('django.db.models.fields.TextField', [], {}), | |
368 | + 'podparad': ('django.db.models.fields.CharField', [], {'max_length': '4', 'blank': 'True'}), | |
369 | + 'pref': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), | |
370 | + 'row': ('django.db.models.fields.IntegerField', [], {}), | |
371 | + 'rowspan': ('django.db.models.fields.IntegerField', [], {}), | |
372 | + 'suf': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), | |
373 | + 'typr': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.PatternType']", 'db_column': "'typr'"}), | |
374 | + 'wariant': ('django.db.models.fields.CharField', [], {'max_length': '4'}) | |
375 | + }, | |
376 | + u'dictionary.partofspeech': { | |
377 | + 'Meta': {'ordering': "['index']", 'object_name': 'PartOfSpeech', 'db_table': "'klasygramatyczne'"}, | |
378 | + 'color_scheme': ('django.db.models.fields.IntegerField', [], {}), | |
379 | + 'full_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_column': "'nazwa'"}), | |
380 | + 'index': ('django.db.models.fields.IntegerField', [], {}), | |
381 | + 'lexical_class': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.LexicalClass']", 'db_column': "'czm'"}), | |
382 | + 'symbol': ('django.db.models.fields.CharField', [], {'max_length': '16', 'primary_key': 'True', 'db_column': "'pos'"}) | |
383 | + }, | |
384 | + u'dictionary.pattern': { | |
385 | + 'Meta': {'ordering': "['name']", 'object_name': 'Pattern', 'db_table': "'wzory'"}, | |
386 | + 'basic_form_ending': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_column': "'zakp'", 'blank': 'True'}), | |
387 | + 'comment': ('django.db.models.fields.TextField', [], {'db_column': "'komentarz'", 'blank': 'True'}), | |
388 | + 'example': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_column': "'przyklad'"}), | |
389 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
390 | + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_column': "'w_id'"}), | |
391 | + 'status': ('django.db.models.fields.CharField', [], {'max_length': '8'}), | |
392 | + 'type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.PatternType']", 'db_column': "'typ'"}) | |
393 | + }, | |
394 | + u'dictionary.patterntype': { | |
395 | + 'Meta': {'object_name': 'PatternType', 'db_table': "'typywzorow'"}, | |
396 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
397 | + 'lexical_class': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.LexicalClass']", 'db_column': "'czm'"}), | |
398 | + 'symbol': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_column': "'wtyp'", 'blank': 'True'}) | |
399 | + }, | |
400 | + u'dictionary.qualifier': { | |
401 | + 'Meta': {'ordering': "['label']", 'unique_together': "(('label', 'vocabulary'),)", 'object_name': 'Qualifier', 'db_table': "'kwalifikatory'"}, | |
402 | + 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'usuniety'"}), | |
403 | + 'exclusion_class': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.QualifierExclusionClass']", 'null': 'True', 'db_column': "'klasa'", 'blank': 'True'}), | |
404 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
405 | + 'label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_column': "'kwal'"}), | |
406 | + 'vocabulary': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'qualifiers'", 'db_column': "'slownik'", 'to': u"orm['dictionary.Vocabulary']"}) | |
407 | + }, | |
408 | + u'dictionary.qualifierexclusionclass': { | |
409 | + 'Meta': {'object_name': 'QualifierExclusionClass', 'db_table': "'klasy_wykluczania'"}, | |
410 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
411 | + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_column': "'nazwa'"}), | |
412 | + 'vocabulary': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Vocabulary']", 'db_column': "'slownik'"}) | |
413 | + }, | |
414 | + u'dictionary.savedexportdata': { | |
415 | + 'Meta': {'object_name': 'SavedExportData'}, | |
416 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
417 | + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), | |
418 | + 'serialized_data': ('django.db.models.fields.TextField', [], {}) | |
419 | + }, | |
420 | + u'dictionary.savedfilter': { | |
421 | + 'Meta': {'unique_together': "(('name', 'user'),)", 'object_name': 'SavedFilter'}, | |
422 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
423 | + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), | |
424 | + 'serialized_filter': ('django.db.models.fields.TextField', [], {}), | |
425 | + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}) | |
426 | + }, | |
427 | + u'dictionary.tablecell': { | |
428 | + 'Meta': {'object_name': 'TableCell', 'db_table': "'komorki_tabel'"}, | |
429 | + 'cell': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['dictionary.Cell']", 'unique': 'True', 'db_column': "'k_id'"}), | |
430 | + 'col': ('django.db.models.fields.IntegerField', [], {}), | |
431 | + 'colspan': ('django.db.models.fields.IntegerField', [], {}), | |
432 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
433 | + 'row': ('django.db.models.fields.IntegerField', [], {}), | |
434 | + 'rowspan': ('django.db.models.fields.IntegerField', [], {}) | |
435 | + }, | |
436 | + u'dictionary.tableheader': { | |
437 | + 'Meta': {'object_name': 'TableHeader', 'db_table': "'naglowki_tabel'"}, | |
438 | + 'col': ('django.db.models.fields.IntegerField', [], {}), | |
439 | + 'colspan': ('django.db.models.fields.IntegerField', [], {}), | |
440 | + 'css_class': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_column': "'styl'"}), | |
441 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
442 | + 'label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_column': "'nagl'", 'blank': 'True'}), | |
443 | + 'row': ('django.db.models.fields.IntegerField', [], {}), | |
444 | + 'rowspan': ('django.db.models.fields.IntegerField', [], {}), | |
445 | + 'table_template': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.TableTemplate']", 'db_column': "'st_id'"}) | |
446 | + }, | |
447 | + u'dictionary.tabletemplate': { | |
448 | + 'Meta': {'object_name': 'TableTemplate', 'db_table': "'szablony_tabel'"}, | |
449 | + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
450 | + 'inflection_characteristic': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.InflectionCharacteristic']", 'db_column': "'charfl'"}), | |
451 | + 'pattern_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.PatternType']", 'db_column': "'wtyp'"}), | |
452 | + 'variant': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['dictionary.Variant']", 'db_column': "'wariant'"}) | |
453 | + }, | |
454 | + u'dictionary.variant': { | |
455 | + 'Meta': {'object_name': 'Variant', 'db_table': "'warianty'"}, | |
456 | + 'id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'primary_key': 'True', 'db_column': "'wariant'"}) | |
457 | + }, | |
458 | + u'dictionary.vocabulary': { | |
459 | + 'Meta': {'object_name': 'Vocabulary', 'db_table': "'slowniki'"}, | |
460 | + 'classifications': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'vocabularies'", 'blank': 'True', 'to': u"orm['dictionary.Classification']"}), | |
461 | + 'editors': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'editable_vocabularies'", 'blank': 'True', 'to': u"orm['auth.User']"}), | |
462 | + 'id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True', 'db_column': "'slownik'"}), | |
463 | + 'lexemes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'vocabularies'", 'blank': 'True', 'through': u"orm['dictionary.LexemeAssociation']", 'to': u"orm['dictionary.Lexeme']"}), | |
464 | + 'managers': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'managed_vocabularies'", 'blank': 'True', 'to': u"orm['auth.User']"}), | |
465 | + 'viewers': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'visible_vocabularies'", 'blank': 'True', 'to': u"orm['auth.User']"}) | |
466 | + } | |
467 | + } | |
468 | + | |
469 | + complete_apps = ['dictionary'] | |
0 | 470 | \ No newline at end of file |
... | ... |
dictionary/models.py
... | ... | @@ -1106,15 +1106,13 @@ class NewTableTemplate(Model): |
1106 | 1106 | attributes = ManyToManyField(LexemeAttribute) |
1107 | 1107 | attribute_values = ManyToManyField(LexemeAttributeValue) |
1108 | 1108 | |
1109 | - def table_cells(self, pattern_type, ic): | |
1109 | + def filter_table_cells(self, pattern_type, ic): | |
1110 | 1110 | # TODO uwzględniać atrybuty |
1111 | - return NewTableCell.objects.filter( | |
1112 | - cell__table_template=self, | |
1111 | + return self.table_cells.filter( | |
1113 | 1112 | inflection_characteristics=ic, |
1114 | - pattern_types=pattern_type).select_related( | |
1115 | - 'cell__base_form_label') | |
1113 | + pattern_types=pattern_type).select_related('base_form_label') | |
1116 | 1114 | |
1117 | - def table_headers(self, pattern_type, ic): | |
1115 | + def filter_table_headers(self, pattern_type, ic): | |
1118 | 1116 | # TODO uwzględniać atrybuty |
1119 | 1117 | return self.headers.filter( |
1120 | 1118 | inflection_characteristics=ic, pattern_types=pattern_type) |
... | ... | @@ -1131,8 +1129,8 @@ class NewTableTemplate(Model): |
1131 | 1129 | def render(self, pattern_type, ic, base_endings, root=u'#', separated=True, |
1132 | 1130 | qualifiers=None, edit_view=True, lip_index=0, |
1133 | 1131 | lip_qualifiers=None, numbers=False): |
1134 | - table_cells = self.table_cells(pattern_type, ic) | |
1135 | - headers = self.table_headers(pattern_type, ic) | |
1132 | + table_cells = self.filter_table_cells(pattern_type, ic) | |
1133 | + headers = self.filter_table_headers(pattern_type, ic) | |
1136 | 1134 | rows = set() |
1137 | 1135 | last_col = 0 |
1138 | 1136 | for table_cell in table_cells: |
... | ... | @@ -1168,7 +1166,7 @@ class NewTableTemplate(Model): |
1168 | 1166 | table_cell = table[y][x] |
1169 | 1167 | assert table_cell['type'] != 'span' |
1170 | 1168 | separator = u'·' if separated else u'' |
1171 | - forms = tc.cell.forms(base_endings, separator, root, lip_qualifiers, | |
1169 | + forms = tc.forms(base_endings, separator, root, lip_qualifiers, | |
1172 | 1170 | lip_index, tc.index, qualifiers=qualifiers, edit_view=edit_view) |
1173 | 1171 | if not forms: |
1174 | 1172 | continue |
... | ... | @@ -1223,14 +1221,9 @@ class NewTableTemplate(Model): |
1223 | 1221 | |
1224 | 1222 | |
1225 | 1223 | class NewCell(Model): |
1226 | - table_template = ForeignKey(NewTableTemplate, related_name='cells') | |
1227 | 1224 | base_form_label = ForeignKey(BaseFormLabel) |
1228 | 1225 | prefix = CharField(max_length=20, blank=True) |
1229 | 1226 | suffix = CharField(max_length=20, blank=True) |
1230 | - #parts_of_speech = ManyToManyField(PartOfSpeech) | |
1231 | - #pattern_types = ManyToManyField(PatternType) | |
1232 | - #inflection_characteristics = ManyToManyField(InflectionCharacteristic) | |
1233 | - #attribute_values = ManyToManyField(LexemeAttributeValue) | |
1234 | 1227 | |
1235 | 1228 | def forms(self, base_endings, separator=u'', root=u'', |
1236 | 1229 | lip_qualifiers=None, lip_index=0, table_index=0, |
... | ... | @@ -1262,9 +1255,12 @@ class NewCell(Model): |
1262 | 1255 | ] |
1263 | 1256 | return forms |
1264 | 1257 | |
1258 | + class Meta: | |
1259 | + abstract = True | |
1260 | + | |
1265 | 1261 | |
1266 | -class NewTableCell(Model): | |
1267 | - cell = ForeignKey(NewCell, related_name='table_cells') | |
1262 | +class NewTableCell(NewCell): | |
1263 | + table_template = ForeignKey(NewTableTemplate, related_name='table_cells') | |
1268 | 1264 | pattern_types = ManyToManyField(PatternType) |
1269 | 1265 | inflection_characteristics = ManyToManyField(InflectionCharacteristic) |
1270 | 1266 | # attribute_values = ManyToManyField(LexemeAttributeValue) |
... | ... | @@ -1276,8 +1272,8 @@ class NewTableCell(Model): |
1276 | 1272 | index = IntegerField() |
1277 | 1273 | |
1278 | 1274 | |
1279 | -class NewExportCell(Model): | |
1280 | - cell = ForeignKey(NewCell, related_name='export_cells') | |
1275 | +class NewExportCell(NewCell): | |
1276 | + table_template = ForeignKey(NewTableTemplate, related_name='export_cells') | |
1281 | 1277 | pattern_types = ManyToManyField(PatternType) |
1282 | 1278 | inflection_characteristics = ManyToManyField(InflectionCharacteristic) |
1283 | 1279 | # attribute_values = ManyToManyField(LexemeAttributeValue) |
... | ... |
dictionary/templates/table_edit_form.html
1 | 1 | <table class="scheme{{ color_scheme }}"> |
2 | 2 | <thead> |
3 | 3 | <tr> |
4 | - {% if params.0 != 'export' %} | |
4 | + {% if form_rows.0.1.0 != 'export' %} | |
5 | 5 | <th>w.</th> |
6 | 6 | <th>k.</th> |
7 | 7 | <th>↕</th> |
8 | 8 | <th>↔</th> |
9 | - {% else %} | |
10 | - <th>tag</th> | |
11 | 9 | {% endif %} |
12 | 10 | <th></th> |
11 | + {% if form_rows.0.1.0 == 'export' %} | |
12 | + <th>tag</th> | |
13 | + {% endif %} | |
13 | 14 | <th>ograniczenia</th> |
14 | 15 | </tr> |
15 | 16 | </thead> |
... | ... | @@ -20,8 +21,6 @@ |
20 | 21 | <td><input type="text" class="col" value="{{ coord.1 }}" size="1"/></td> |
21 | 22 | <td><input type="text" class="rspan" value="{{ coord.2 }}" size="1"/></td> |
22 | 23 | <td><input type="text" class="cspan" value="{{ coord.3 }}" size="1"/></td> |
23 | - {% else %} | |
24 | - <td><input type="text" class="tag" value="{{ coord }}"/></td> | |
25 | 24 | {% endif %} |
26 | 25 | <td> |
27 | 26 | {% if params.0 == 'table' %} |
... | ... | @@ -37,6 +36,9 @@ |
37 | 36 | {{ params.2.css_class }} |
38 | 37 | {% endif %} |
39 | 38 | </td> |
39 | + {% if params.0 == 'export' %} | |
40 | + <td><input type="text" class="tag" value="{{ coord }}"/></td> | |
41 | + {% endif %} | |
40 | 42 | <td>{{ form.as_ul }}</td> |
41 | 43 | </tr> |
42 | 44 | {% endfor %} |
... | ... |