376 return rschema |
376 return rschema |
377 |
377 |
378 def add_subject_relation(self, rschema): |
378 def add_subject_relation(self, rschema): |
379 """register the relation schema as possible subject relation""" |
379 """register the relation schema as possible subject relation""" |
380 super(CubicWebEntitySchema, self).add_subject_relation(rschema) |
380 super(CubicWebEntitySchema, self).add_subject_relation(rschema) |
381 self._update_has_text() |
381 if rschema.final: |
|
382 if self.rdef(rschema).get('fulltextindexed'): |
|
383 self._update_has_text() |
|
384 elif rschema.fulltext_container: |
|
385 self._update_has_text() |
|
386 |
|
387 def add_object_relation(self, rschema): |
|
388 """register the relation schema as possible object relation""" |
|
389 super(CubicWebEntitySchema, self).add_object_relation(rschema) |
|
390 if rschema.fulltext_container: |
|
391 self._update_has_text() |
382 |
392 |
383 def del_subject_relation(self, rtype): |
393 def del_subject_relation(self, rtype): |
384 super(CubicWebEntitySchema, self).del_subject_relation(rtype) |
394 super(CubicWebEntitySchema, self).del_subject_relation(rtype) |
385 self._update_has_text(True) |
395 if 'has_text' in self.subjrels: |
|
396 self._update_has_text(deletion=True) |
|
397 |
|
398 def del_object_relation(self, rtype): |
|
399 super(CubicWebEntitySchema, self).del_object_relation(rtype) |
|
400 if 'has_text' in self.subjrels: |
|
401 self._update_has_text(deletion=True) |
386 |
402 |
387 def _update_has_text(self, deletion=False): |
403 def _update_has_text(self, deletion=False): |
388 may_need_has_text, has_has_text = False, False |
404 may_need_has_text, has_has_text = False, False |
389 need_has_text = None |
405 need_has_text = None |
390 for rschema in self.subject_relations(): |
406 for rschema in self.subject_relations(): |