from sets.admin import *
from .models import *
from django.contrib import admin

class Admin_SubscribeOrder(Admin_BaseModel):

    fieldsets = (
        (None, {
            'classes': ['wide'],
            'fields': (
                ('user', 'subscribe', 'subscribe_for_user'),
                ('enable', 'order'),
                ('sum', 'currency'),
                ('status', 'last_operation_status'),
                ('bank_order_id', 'pay_page'),
                'json_data',
            )
        }),
    )

    list_display = [
        'id', 'enable',
        'user', 'subscribe', 'subscribe_for_user',
        'bank_order_id',
        'sum', 'currency',
        'status', 'last_operation_status',
        'order', 'modifiedDT', 'createDT'
    ]

    list_display_links = ['id', 'user', 'subscribe']
    list_editable = ['enable']

    readonly_fields = ['subscribe_for_user', 'sum', 'currency', 'modifiedDT', 'createDT']

    list_filter = ['enable', 'status', 'modifiedDT', 'createDT']
    search_fields = ['id', 'last_operation_status', 'status']
    # filter_horizontal = ['options']

admin.site.register(SubscribeOrder, Admin_SubscribeOrder)