コード例 #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
ファイル: tables.py プロジェクト: githubuser0xFFFF/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)
コード例 #3
0
ファイル: columns.py プロジェクト: exekias/django-achilles
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
ファイル: columns.py プロジェクト: exekias/django-achilles
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
ファイル: tables.py プロジェクト: githubuser0xFFFF/droplet
def delete(transport, table, obj):
    obj.delete()
    blocks.update(transport, table.register_name)
コード例 #6
0
ファイル: actions.py プロジェクト: blaxter/django-achilles
def delete_person(request, table, person):
    person.delete()
    blocks.update(request, 'example:mytable')
コード例 #7
0
ファイル: actions.py プロジェクト: blaxter/django-achilles
def miau_person(request, table, person):
    person.last_name = 'Miau ' + person.last_name
    person.save()
    blocks.update(request, 'example:mytable')
コード例 #8
0
ファイル: blocks.py プロジェクト: blaxter/django-achilles
 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)