예제 #1
0
def object_modified(model_instance, object_event):
    """Subscription handler for `Storm` modification events."""
    edited_fields = object_event.edited_fields
    if edited_fields is not None and len(edited_fields) != 0:
        edited_field_names = sorted(
            (field.__name__ if IAttribute.providedBy(field) else field)
            for field in edited_fields)
        event = ILongPollEvent(model_instance)
        event.emit(
            what="modified", edited_fields=edited_field_names,
            id=get_primary_key(model_instance))
예제 #2
0
def object_modified(model_instance, object_event):
    """Subscription handler for `Storm` modification events."""
    edited_fields = object_event.edited_fields
    if edited_fields is not None and len(edited_fields) != 0:
        edited_field_names = sorted(
            (field.__name__ if IAttribute.providedBy(field) else field)
            for field in edited_fields)
        event = ILongPollEvent(model_instance)
        event.emit(what="modified",
                   edited_fields=edited_field_names,
                   id=get_primary_key(model_instance))
예제 #3
0
def object_deleted(model_instance, object_event):
    """Subscription handler for `Storm` deletion events."""
    event = ILongPollEvent(model_instance)
    event.emit(what="deleted", id=get_primary_key(model_instance))
예제 #4
0
def object_created(model_instance, object_event):
    """Subscription handler for `Storm` creation events."""
    model_class = removeSecurityProxy(model_instance).__class__
    event = ILongPollEvent(model_class)
    event.emit(what="created", id=get_primary_key(model_instance))
예제 #5
0
def object_deleted(model_instance, object_event):
    """Subscription handler for `Storm` deletion events."""
    event = ILongPollEvent(model_instance)
    event.emit(what="deleted", id=get_primary_key(model_instance))
예제 #6
0
def object_created(model_instance, object_event):
    """Subscription handler for `Storm` creation events."""
    model_class = removeSecurityProxy(model_instance).__class__
    event = ILongPollEvent(model_class)
    event.emit(what="created", id=get_primary_key(model_instance))