814 def __call__(self): |
814 def __call__(self): |
815 # workflow cleanup |
815 # workflow cleanup |
816 self._cw.execute('DELETE Workflow X WHERE NOT X workflow_of Y') |
816 self._cw.execute('DELETE Workflow X WHERE NOT X workflow_of Y') |
817 |
817 |
818 |
818 |
819 <<<<<<< /home/syt/src/fcubicweb/cubicweb/hooks/syncschema.py |
|
820 class AfterAddCWETypeHook(DelCWETypeHook): |
819 class AfterAddCWETypeHook(DelCWETypeHook): |
821 ======= |
|
822 def after_del_relation_type(session, rdefeid, rtype, rteid): |
|
823 |
|
824 |
|
825 # addition hooks ############################################################### |
|
826 |
|
827 def before_add_eetype(session, entity): |
|
828 """before adding a CWEType entity: |
|
829 * check that we are not using an existing entity type, |
|
830 """ |
|
831 name = entity['name'] |
|
832 schema = session.schema |
|
833 if name in schema and schema[name].eid is not None: |
|
834 raise RepositoryError('an entity type %s already exists' % name) |
|
835 |
|
836 def after_add_eetype(session, entity): |
|
837 >>>>>>> /tmp/schemahooks.py~other.2drHhu |
|
838 """after adding a CWEType entity: |
820 """after adding a CWEType entity: |
839 * create the necessary table |
821 * create the necessary table |
840 * set creation_date and modification_date by creating the necessary |
822 * set creation_date and modification_date by creating the necessary |
841 CWAttribute entities |
823 CWAttribute entities |
842 * add owned_by relation by creating the necessary CWRelation entity |
824 * add owned_by relation by creating the necessary CWRelation entity |