Commit 7de6ca4d authored by chirac's avatar chirac

Le ban a comme date de début sa création

parent 279b754c
......@@ -13,6 +13,7 @@
<th>Prix unitaire</th>
<th>Moyen de paiement</th>
<th>Date</th>
<th></th>
</tr>
</thead>
{% for facture in facture_list %}
......@@ -23,6 +24,7 @@
<td>{{ facture.prix }}</td>
<td>{{ facture.paiement }}</td>
<td>{{ facture.date }}</td>
<td><a href="{% url 'cotisations:edit-facture' facture.id %}">Editer</a></td>
</tr>
{% endfor %}
</table>
......
# -*- 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),
),
]
# -*- 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,
),
]
......@@ -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:
......
......@@ -10,6 +10,7 @@
<th>Prénom</th>
<th>Nom</th>
<th>Pseudo</th>
<th>Inscrit le</th>
<th>Modifier</th>
</tr>
</thead>
......@@ -18,6 +19,7 @@
<td>{{ user.name }}</td>
<td>{{ user.surname }}</td>
<td>{{ user.pseudo }}</td>
<td>{{ user.registered }}</td>
<td><a href="{% url 'users:edit-info' user.id %}">Editer</a></td>
</tr>
{% endfor %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment