ERRORS: <class 'Product.admin.ProductAdmin'>: (admin.E108) The value of 'list_display[3]' refers to 'updated_ad', which is not a callable, an attribute of 'ProductAdmin', or an attribute or method on 'Product.Product'.

Submitted 4 years, 3 months ago
Ticket #331
Views 1134
Language/Framework Django
Priority Low
Status Closed

from django.contrib import admin

# Register your models here.

from Product.models import Catagory, Product


 

admin.site.register(Catagory)




 

class ProductAdmin(admin.ModelAdmin):

    list_display = ['title', 'status', 'created_at', 'updated_ad', 'image_tag']

    list_filter = ['title', 'created_at']

    list_per_page = 10

    search_fields = ['title', 'new_price', 'detail']

    

admin.site.register(Product, ProductAdmin)

Submitted on Jan 07, 21
Pro

can you share Product model ? - Vengat 4 years, 3 months ago

class Product(models.Model): status = ( ('True', 'True'), ('False', 'False'),) Catagory = models.ForeignKey(Catagory, on_delete=models.CASCADE) title = models.CharField(max_length=200) keywords = models.CharField(max_length=100) image = models.ImageField(blank=True, upload_to='catagory/') new_price = models.DecimalField(decimal_places=2, max_digits=15, default=0) old_price = models.DecimalField(decimal_places=2, max_digits=15) amount = models.IntegerField(default=0) detail = models.TextField() status = models.CharField(max_length=20, choices=status) slug = models.SlugField(null=True, unique=True) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) - Pro 4 years, 3 months ago

as we are not getting any response. we are closing the ticket. - Vengat 4 years, 3 months ago
add a comment

1 Answer

Verified

Based on your model, i dont see update_ad field. It should be updated_at field in your admin.py file.

Submitted 4 years, 3 months ago


Latest Blogs