Clarification attribut AccountNegative

- frozen -> is_frozen
- migration :
    - AccountNegative : frozen -> is_frozen
    - Rajout d'un default sur Checkout.balance
This commit is contained in:
Aurélien Delobelle 2016-08-04 06:00:47 +02:00
parent bc1c0110f1
commit 092c3ce5d4
3 changed files with 30 additions and 2 deletions

View file

@ -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),
),
]

View file

@ -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(

View file

@ -25,7 +25,7 @@
<p>Département: {{ account.cofprofile.departement }}</p>
<p>Promo: {{ account.promo }}</p>
<p>Statut COF: {{ account.cofprofile.is_cof }}</p>
<p>Compte gelé: {{ account.frozen }}</p>
<p>Compte gelé: {{ account.is_frozen }}</p>
<p>Solde: {{ account.balance }} €</p>
{% if account.balance != account.real_balance %}
<p>Solde réel: {{ account.real_balance }} €</p>