diff --git a/cotisations/templates/cotisations/index.html b/cotisations/templates/cotisations/index.html index ce326948..0248920c 100644 --- a/cotisations/templates/cotisations/index.html +++ b/cotisations/templates/cotisations/index.html @@ -13,6 +13,7 @@ Prix unitaire Moyen de paiement Date + {% for facture in facture_list %} @@ -23,6 +24,7 @@ {{ facture.prix }} {{ facture.paiement }} {{ facture.date }} + Editer {% endfor %} diff --git a/users/__pycache__/models.cpython-34.pyc b/users/__pycache__/models.cpython-34.pyc index 4d9f3b10..d62f0a89 100644 Binary files a/users/__pycache__/models.cpython-34.pyc and b/users/__pycache__/models.cpython-34.pyc differ diff --git a/users/migrations/0007_auto_20160702_2322.py b/users/migrations/0007_auto_20160702_2322.py new file mode 100644 index 00000000..ad1b0d8a --- /dev/null +++ b/users/migrations/0007_auto_20160702_2322.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0006_ban'), + ] + + operations = [ + migrations.AlterField( + model_name='ban', + name='date_start', + field=models.DateTimeField(auto_now_add=True), + ), + ] diff --git a/users/migrations/0008_user_registered.py b/users/migrations/0008_user_registered.py new file mode 100644 index 00000000..430f0061 --- /dev/null +++ b/users/migrations/0008_user_registered.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +from django.utils.timezone import utc +import datetime + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0007_auto_20160702_2322'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='registered', + field=models.DateTimeField(auto_now_add=True, default=datetime.datetime(2016, 7, 2, 23, 25, 21, 698883, tzinfo=utc)), + preserve_default=False, + ), + ] diff --git a/users/migrations/__pycache__/0007_auto_20160702_2322.cpython-34.pyc b/users/migrations/__pycache__/0007_auto_20160702_2322.cpython-34.pyc new file mode 100644 index 00000000..ec7a409b Binary files /dev/null and b/users/migrations/__pycache__/0007_auto_20160702_2322.cpython-34.pyc differ diff --git a/users/migrations/__pycache__/0008_user_registered.cpython-34.pyc b/users/migrations/__pycache__/0008_user_registered.cpython-34.pyc new file mode 100644 index 00000000..d92dba68 Binary files /dev/null and b/users/migrations/__pycache__/0008_user_registered.cpython-34.pyc differ diff --git a/users/models.py b/users/models.py index 86b3b7dd..aeea40c3 100644 --- a/users/models.py +++ b/users/models.py @@ -21,6 +21,7 @@ class User(models.Model): pwd_ssha = models.CharField(max_length=255) pwd_ntlm = models.CharField(max_length=255) state = models.IntegerField(choices=STATES, default=STATE_ACTIVE) + registered = models.DateTimeField(auto_now_add=True) def __str__(self): return self.pseudo @@ -50,7 +51,7 @@ class ListRight(models.Model): class Ban(models.Model): user = models.ForeignKey('User', on_delete=models.PROTECT) raison = models.CharField(max_length=255) - date_start = models.DateTimeField(help_text='%m/%d/%y %H:%M:%S') + date_start = models.DateTimeField(auto_now_add=True) date_end = models.DateTimeField(help_text='%m/%d/%y %H:%M:%S') def __str__(self): @@ -113,7 +114,6 @@ class DelRightForm(ModelForm): class BanForm(ModelForm): def __init__(self, *args, **kwargs): super(BanForm, self).__init__(*args, **kwargs) - self.fields['date_start'].label = 'Date de début' self.fields['date_end'].label = 'Date de fin' class Meta: diff --git a/users/templates/users/index.html b/users/templates/users/index.html index a2f9ce5d..651ca085 100644 --- a/users/templates/users/index.html +++ b/users/templates/users/index.html @@ -10,6 +10,7 @@ Prénom Nom Pseudo + Inscrit le Modifier @@ -18,6 +19,7 @@ {{ user.name }} {{ user.surname }} {{ user.pseudo }} + {{ user.registered }} Editer {% endfor %}