from django.contrib import admin

from .models import Product


class ProductAdmin(admin.ModelAdmin):
    list_display = ('description', 'product_type', 'account_number')
    ordering = ('description',)

    class Meta:
        model = Product


admin.site.register(Product, ProductAdmin)

from django.contrib import admin

from .models import Product


class ProductAdmin(admin.ModelAdmin):
    list_display = ('description', 'product_type', 'account_number')
    ordering = ('description',)
    readonly_fields = ('description', 'product_type', 'product_id')

    class Meta:
        model = Product


admin.site.register(Product, ProductAdmin)

Make Shopify product fields readonly
Make Shopify product fields readonly

  from django.contrib import admin
  
  from .models import Product
  
  
  class ProductAdmin(admin.ModelAdmin):
      list_display = ('description', 'product_type', 'account_number')
      ordering = ('description',)
+     readonly_fields = ('description', 'product_type', 'product_id')
  
      class Meta:
          model = Product
  
  
  admin.site.register(Product, ProductAdmin)
  
Make Shopify product fields readonly
## Code Before:
from django.contrib import admin

from .models import Product


class ProductAdmin(admin.ModelAdmin):
    list_display = ('description', 'product_type', 'account_number')
    ordering = ('description',)

    class Meta:
        model = Product


admin.site.register(Product, ProductAdmin)

## Instruction:
Make Shopify product fields readonly
## Code After:
from django.contrib import admin

from .models import Product


class ProductAdmin(admin.ModelAdmin):
    list_display = ('description', 'product_type', 'account_number')
    ordering = ('description',)
    readonly_fields = ('description', 'product_type', 'product_id')

    class Meta:
        model = Product


admin.site.register(Product, ProductAdmin)
