Skip to content

Commit

Permalink
Merge pull request #500 from VIBR0X/buyandsell
Browse files Browse the repository at this point in the history
add filters in backend
  • Loading branch information
VIBR0X authored Aug 7, 2023
2 parents 45b5a1b + 83f9537 commit 53abf33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion buyandsell/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
from buyandsell.models import Ban, Category, ImageURL, Product, Report

# Register your models here.
admin.site.register(Product)
admin.site.register(Category)
admin.site.register(ImageURL)
admin.site.register(Report)
admin.site.register(Ban)

class ProductAdmin(admin.ModelAdmin):
list_display = ('name', 'user', 'description', 'brand', 'time_of_creation', 'deleted', 'status')
list_filter = ('status', 'deleted')
search_fields = ('title', 'category', 'user')
ordering = ('-time_of_creation',)

admin.site.register(Product, ProductAdmin)
2 changes: 1 addition & 1 deletion upload/management/commands/clean-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def handle(self, *args, **options):
Body.objects.filter(image_url__contains=url),
ComplaintImage.objects.filter(image_url__contains=url),
Community.objects.filter(Q(logo_image__contains=url) | Q(cover_image__contains=url)),
CommunityPost.objects.filter(image_url__contains=url) |
CommunityPost.objects.filter(image_url__contains=url),
Product.objects.filter(product_image__contains=url)
]

Expand Down

0 comments on commit 53abf33

Please sign in to comment.