Backend (Django 4.2 + DRF): - accounts: phone OTP login, JWT, profile, addresses - catalog: categories, products, images, filters, search, hits/new/related - orders: creation with Idempotency-Key, stock reservation, status history, cancel - loyalty: bonus accounts, promo codes, gift certificates - payments: payment records and YooKassa webhook handling - content: static pages, banners, site settings - integration: 1C exchange (catalog sync, order push via outbox, statuses, bonuses) - common: error envelope, pagination, request-id, integration auth, admin dashboard Infrastructure: Dockerfile, docker-compose (Postgres, Redis, Celery worker/beat, Nginx), requirements split by environment, OpenAPI contracts for site and 1C, architecture doc. Tests: 22 pytest cases covering catalog, orders, idempotency, OTP, integration.
30 lines
782 B
Python
30 lines
782 B
Python
from django.contrib import admin
|
|
from django.contrib.admin.models import LogEntry
|
|
|
|
|
|
class LogEntryAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"action_time",
|
|
"user",
|
|
"content_type",
|
|
"object_repr",
|
|
"action_flag",
|
|
"change_message",
|
|
)
|
|
list_filter = ("action_flag", "content_type", "user")
|
|
search_fields = ("object_repr", "change_message")
|
|
readonly_fields = [field.name for field in LogEntry._meta.fields]
|
|
|
|
def has_add_permission(self, request):
|
|
return False
|
|
|
|
def has_change_permission(self, request, obj=None):
|
|
return False
|
|
|
|
def has_delete_permission(self, request, obj=None):
|
|
return False
|
|
|
|
|
|
if not admin.site.is_registered(LogEntry):
|
|
admin.site.register(LogEntry, LogEntryAdmin)
|