Подводные камни Django админка

Discussion in 'PHP' started by ^NSA^, 23 Sep 2014.

  1. ^NSA^

    ^NSA^ Elder - Старейшина

    Joined:
    3 Jul 2012
    Messages:
    69
    Likes Received:
    29
    Reputations:
    32
    Как передать GET запрос в do_send действия admin.py действия.
    POST то проходить.

    пример
    Code:
    class BlogAdminCategory(admin.ModelAdmin):
    
        def do_send(self, request, queryset):
            response = HttpResponse(content_type="application/json")
            serializers.serialize("json", queryset, stream=response)
            return response
        do_send.short_description = 'Hide'
    
        actions = [
            do_send
        ]
        save_on_top= True
        list_display =('title_category','pub_date','hide_me',)
        
        def hide_me(self, obj):
            # how to send param not from post but   get like category
            return '<a href="send_do?id={0}">Hide</a>'.format(obj.id)  
        
        hide_me.short_description = 'Hide'
        hide_me.allow_tags = True
    
    
    в админку
    -------------------------------------------------
    title 2014.02 (button)
    -----------------------------------------------

    пс пилить админку или заново строить .
     
Loading...
Similar Threads - Подводные камни Django
  1. ^NSA^
    Replies:
    0
    Views:
    1,005
  2. ^NSA^
    Replies:
    0
    Views:
    1,109
  3. [XTR]
    Replies:
    3
    Views:
    1,478