Add OrderStatus to Django admin with Russian translations
- Add OrderStatusAdmin to admin panel with custom display methods - Implement color preview, order badge, and order count displays - Protect system statuses from deletion and code modification - Add orders_count property to OrderStatus model - Create migration to translate status names to Russian - Use format_html for safe HTML rendering in admin 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -99,6 +99,11 @@ class OrderStatus(models.Model):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
@property
|
||||
def orders_count(self):
|
||||
"""Количество заказов в этом статусе"""
|
||||
return self.orders.count()
|
||||
|
||||
|
||||
class Address(models.Model):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user