예제 #1
0
파일: tables.py 프로젝트: exekias/droplet
    def form_valid(self, transport, form, table_name=None,
                   column_name=None, obj_id=None):

        # Save the form
        form.save()

        # Update the table
        blocks.update(transport, table_name)
예제 #2
0
    def form_valid(self,
                   transport,
                   form,
                   table_name=None,
                   column_name=None,
                   obj_id=None):

        # Save the form
        form.save()

        # Update the table
        blocks.update(transport, table_name)
예제 #3
0
def table_action(transport, table_name, action_name, *args, **kwargs):
    """
    Call table action

    :param transport: achilles transport
    :param table_name: Name of the table calling this
    :param action_name: Name of the action to call
    """
    # Get TableAction item
    context = RequestContext(transport.request, {})
    table = blocks.get(table_name, context)
    action = getattr(table, action_name)

    # Call the action
    res = action.call(transport, table, *args, **kwargs)
    blocks.update(transport, table.register_name)
    return res
예제 #4
0
def row_action(transport, table_name, action_name, row_id, *args, **kwargs):
    """
    Call table action on the given row

    :param transport: achilles transport
    :param table_name: Name of the table calling this
    :param action_name: Name of the action to call
    :param row_id: Id of the object
    """
    # Get TableAction item
    context = RequestContext(transport.request, {})
    table = blocks.get(table_name, context)
    action = getattr(table, action_name)

    # Get the object from the row
    obj = table.get_object(row_id)

    # Call the action
    res = action.call(transport, table, obj, *args, **kwargs)
    blocks.update(transport, table.register_name)
    return res
예제 #5
0
def delete(transport, table, obj):
    obj.delete()
    blocks.update(transport, table.register_name)
예제 #6
0
def delete_person(request, table, person):
    person.delete()
    blocks.update(request, 'example:mytable')
예제 #7
0
def miau_person(request, table, person):
    person.last_name = 'Miau ' + person.last_name
    person.save()
    blocks.update(request, 'example:mytable')
예제 #8
0
 def form_valid(self, request, form):
     Person.objects.get_or_create(**form.cleaned_data)
     blocks.update(request, 'example:mytable')
예제 #9
0
파일: tables.py 프로젝트: exekias/droplet
def delete(transport, table, obj):
    obj.delete()
    blocks.update(transport, table.register_name)