From 092c3ce5d4fb0d8d2ea0ae94b445859051b80fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Thu, 4 Aug 2016 06:00:47 +0200 Subject: [PATCH] Clarification attribut AccountNegative - frozen -> is_frozen - migration : - AccountNegative : frozen -> is_frozen - Rajout d'un default sur Checkout.balance --- kfet/migrations/0006_auto_20160804_0600.py | 28 ++++++++++++++++++++++ kfet/models.py | 2 +- kfet/templates/kfet/account_read.html | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 kfet/migrations/0006_auto_20160804_0600.py diff --git a/kfet/migrations/0006_auto_20160804_0600.py b/kfet/migrations/0006_auto_20160804_0600.py new file mode 100644 index 00000000..063504b9 --- /dev/null +++ b/kfet/migrations/0006_auto_20160804_0600.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('kfet', '0005_auto_20160802_2154'), + ] + + operations = [ + migrations.AlterModelOptions( + name='checkout', + options={'ordering': ['-valid_to']}, + ), + migrations.RenameField( + model_name='account', + old_name='frozen', + new_name='is_frozen', + ), + migrations.AlterField( + model_name='checkout', + name='balance', + field=models.DecimalField(max_digits=6, default=0, decimal_places=2), + ), + ] diff --git a/kfet/models.py b/kfet/models.py index fddc8a4b..264abbe5 100644 --- a/kfet/models.py +++ b/kfet/models.py @@ -26,7 +26,7 @@ class Account(models.Model): balance = models.DecimalField( max_digits = 6, decimal_places = 2, default = 0) - frozen = models.BooleanField(default = False) + is_frozen = models.BooleanField(default = False) # Optional PROMO_CHOICES = [(r,r) for r in range(1980, datetime.date.today().year+1)] promo = models.IntegerField( diff --git a/kfet/templates/kfet/account_read.html b/kfet/templates/kfet/account_read.html index ac7de714..011ef1d4 100644 --- a/kfet/templates/kfet/account_read.html +++ b/kfet/templates/kfet/account_read.html @@ -25,7 +25,7 @@

Département: {{ account.cofprofile.departement }}

Promo: {{ account.promo }}

Statut COF: {{ account.cofprofile.is_cof }}

-

Compte gelé: {{ account.frozen }}

+

Compte gelé: {{ account.is_frozen }}

Solde: {{ account.balance }} €

{% if account.balance != account.real_balance %}

Solde réel: {{ account.real_balance }} €