Exemplo n.º 1
0
def sync_moved_proposal(obj, event):
    # Skip automatically renamed objects during copy & paste process.
    if ICopyPasteRequestLayer.providedBy(getRequest()):
        return

    # make sure obj wasn't just created or deleted
    if not event.oldParent or not event.newParent:
        return

    obj.sync_model()
Exemplo n.º 2
0
def sync_moved_proposal(obj, event):
    # Skip automatically renamed objects during copy & paste process.
    if ICopyPasteRequestLayer.providedBy(getRequest()):
        return

    # make sure obj wasn't just created or deleted
    if not event.oldParent or not event.newParent:
        return

    ProposalSqlSyncer(obj, event).sync()
Exemplo n.º 3
0
def object_will_be_moved(context, event):
    if IObjectWillBeAddedEvent.providedBy(event):
        return

    # Skip automatically renamed objects during copy & paste process.
    if ICopyPasteRequestLayer.providedBy(getRequest()):
        return

    title = _(u'label_object_cut',
              default=u'Object cut: ${title}',
              mapping={'title': context.title_or_id()})

    journal_entry_factory(context.aq_inner.aq_parent,
                          OBJECT_WILL_BE_MOVED_EVENT, title)
    return
Exemplo n.º 4
0
def object_will_be_moved(context, event):
    if IObjectWillBeAddedEvent.providedBy(event):
        return

    # Skip automatically renamed objects during copy & paste process.
    if ICopyPasteRequestLayer.providedBy(getRequest()):
        return

    title = _(u'label_object_cut',
              default=u'Object cut: ${title}',
              mapping={'title': context.title_or_id()}
              )

    journal_entry_factory(
        context.aq_inner.aq_parent, OBJECT_WILL_BE_MOVED_EVENT, title)
    return
Exemplo n.º 5
0
def object_moved(context, event):
    # Since IObjectAddedEvent subclasses IObjectMovedEvent this event
    # handler is also called for IObjectAddedEvent but we should not
    # do anything in this case.
    if IObjectAddedEvent.providedBy(event):
        return

    # Skip automatically renamed objects during copy & paste process.
    if ICopyPasteRequestLayer.providedBy(getRequest()):
        return

    title = _(u'label_object_moved',
              default=u'Object moved: ${title}',
              mapping={'title': context.title_or_id()})

    journal_entry_factory(context.aq_inner.aq_parent, OBJECT_MOVED_EVENT,
                          title)
    return
Exemplo n.º 6
0
def object_moved(context, event):
    # Since IObjectAddedEvent subclasses IObjectMovedEvent this event
    # handler is also called for IObjectAddedEvent but we should not
    # do anything in this case.
    if IObjectAddedEvent.providedBy(event):
        return

    # Skip automatically renamed objects during copy & paste process.
    if ICopyPasteRequestLayer.providedBy(getRequest()):
        return

    title = _(u'label_object_moved',
              default=u'Object moved: ${title}',
              mapping={'title': context.title_or_id()}
              )

    journal_entry_factory(
        context.aq_inner.aq_parent, OBJECT_MOVED_EVENT, title)
    return