plus élégant
This commit is contained in:
parent
065ee38f58
commit
5d1d9ee5ad
@ -15,8 +15,7 @@ def submit_row_tag(parser, token):
|
||||
|
||||
@register.simple_tag
|
||||
def emballe(quantité, fourniture):
|
||||
quotient = quantité // fourniture.conditionnement
|
||||
reste = quantité % fourniture.conditionnement
|
||||
quotient, reste = divmod(quantité, fourniture.conditionnement)
|
||||
if not reste and quotient == 1:
|
||||
return f"{quotient} {fourniture.emballage}"
|
||||
if not reste and quotient > 1:
|
||||
|
Loading…
Reference in New Issue
Block a user