Initial commit: Django project with boxes app
- Set up Django 5.2.9 project structure - Add boxes app with Box and BoxType models - Box: alphanumeric ID (max 10 chars) with foreign key to BoxType - BoxType: name and dimensions (width/height/length in mm) - Configure admin interface for both models - Add comprehensive test suite (14 tests)
This commit is contained in:
20
boxes/admin.py
Normal file
20
boxes/admin.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import Box, BoxType
|
||||
|
||||
|
||||
@admin.register(BoxType)
|
||||
class BoxTypeAdmin(admin.ModelAdmin):
|
||||
"""Admin configuration for BoxType model."""
|
||||
|
||||
list_display = ('name', 'width', 'height', 'length')
|
||||
search_fields = ('name',)
|
||||
|
||||
|
||||
@admin.register(Box)
|
||||
class BoxAdmin(admin.ModelAdmin):
|
||||
"""Admin configuration for Box model."""
|
||||
|
||||
list_display = ('id', 'box_type')
|
||||
list_filter = ('box_type',)
|
||||
search_fields = ('id',)
|
||||
Reference in New Issue
Block a user