Source

gnocchi-catalogue / catalogue / admin.py

Full commit
from django.contrib import admin
from gnocchi_catalogue import models
from gnocchi_tools.admin import InlineAttributeAdmin

class InlinePriceBreakAdmin(admin.TabularInline):
    model = models.PriceBreak
    extra = 0

class InlineVariantAdmin(admin.TabularInline):
    model = models.ProductVariant
    extra = 0

class InlineImageAdmin(admin.TabularInline):
    model = models.Image
    extra = 0

class InlineSubProductAdmin(admin.TabularInline):
    model = models.SubProduct
    extra = 0

class ProductAdmin(admin.ModelAdmin):
    list_display = ('title', 'price', 'short_description', 'get_codes',)
    list_filter = ('price',)
    filter_horizontal = ('related_products',)
    inlines = [
        InlineSubProdictAdmin,
        InlineVariantAdmin,
        InlineImageAdmin,
        InlinePriceBreakAdmin,
        InlineAttributeAdmin,
    ]
    def get_codes(self, obj):
        return u', '.join(obj.productvariant_set.values_list('sku', flat=True))
    get_codes.short_description = 'Codes'

admin.site.register(models.Product, ProductAdmin)