Exemplo n.º 1
0
def get_receiver_list(session, tid, language):
    return [admin_serialize_receiver(session, receiver, user, language)
        for receiver, user in session.query(models.Receiver, models.User) \
                                     .filter(models.Receiver.id == models.User.id,
                                             models.UserTenant.user_id == models.User.id,
                                             models.UserTenant.tenant_id == tid) \
                                     .order_by(models.User.id)]
Exemplo n.º 2
0
def get_receiver_list(store, language):
    """
    Returns:
        (list) the list of receivers
    """
    return [admin_serialize_receiver(store, receiver, user, language)
        for receiver, user in store.find((models.Receiver, models.User), models.Receiver.id == models.User.id)]
Exemplo n.º 3
0
def update_receiver(session, tid, receiver_id, request, language):
    """
    Updates the specified receiver with the details.
    """
    fill_localized_keys(request, models.Receiver.localized_keys, language)

    receiver, user = db_get_receiver(session, tid, receiver_id)

    receiver.update(request)

    return admin_serialize_receiver(session, receiver, user, language)
Exemplo n.º 4
0
def update_receiver(store, receiver_id, request, language):
    """
    Updates the specified receiver with the details.
    """
    fill_localized_keys(request, models.Receiver.localized_keys, language)

    receiver, user = db_get_receiver(store, receiver_id)

    receiver.update(request)

    db_associate_context_receivers(store, receiver, request['contexts'])

    return admin_serialize_receiver(store, receiver, user, language)
Exemplo n.º 5
0
def get_receiver(session, tid, receiver_id, language):
    receiver, user = db_get_receiver(session, tid, receiver_id)
    return admin_serialize_receiver(session, receiver, user, language)
Exemplo n.º 6
0
def get_receiver(store, receiver_id, language):
    receiver, user = db_get_receiver(store, receiver_id)
    return admin_serialize_receiver(store, receiver, user, language)