from django.contrib import admin

from oscar.apps.shipping import admin as oscar
from oscar.apps.shipping.admin import *  # noqa  pylint: disable=W0401,W0614
from oscar.core.loading import get_model

ProductBased = get_model("shipping", "ProductBased")


# pylint: disable=E0102
class WeightBasedAdmin(oscar.WeightBasedAdmin):
    list_display = ("name", "description")


class ProductBasedAdmin(admin.ModelAdmin):
    filter_horizontal = ("countries",)


admin.site.unregister(WeightBased)
admin.site.register(WeightBased, WeightBasedAdmin)
admin.site.register(ProductBased, ProductBasedAdmin)
