First commit of claude's rework in django + vanillajs fronted

This commit is contained in:
Gérald Colangelo
2026-04-02 11:24:30 +02:00
parent 7710a876df
commit fde92f92db
163 changed files with 84852 additions and 15 deletions

View File

@@ -0,0 +1,22 @@
"""Shared serializer helper functions used across multiple apps."""
def ammo_detail(ammo):
if ammo is None:
return None
cal = ammo.caliber
return {
'id': ammo.id, 'brand': ammo.brand, 'name': ammo.name,
'caliber_detail': {'id': cal.id, 'name': cal.name} if cal else None,
}
def batch_detail(batch):
if batch is None:
return None
return {
'id': batch.id,
'recipe_name': batch.recipe.name,
'powder': str(batch.powder),
'powder_charge_gr': str(batch.powder_charge_gr),
}