Browse Source

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

test_david
chirac 10 years ago
parent
commit
7de6ca4ddb
  1. 2
      cotisations/templates/cotisations/index.html
  2. BIN
      users/__pycache__/models.cpython-34.pyc
  3. 19
      users/migrations/0007_auto_20160702_2322.py
  4. 22
      users/migrations/0008_user_registered.py
  5. BIN
      users/migrations/__pycache__/0007_auto_20160702_2322.cpython-34.pyc
  6. BIN
      users/migrations/__pycache__/0008_user_registered.cpython-34.pyc
  7. 4
      users/models.py
  8. 2
      users/templates/users/index.html

2
cotisations/templates/cotisations/index.html

@ -13,6 +13,7 @@
<th>Prix unitaire</th> <th>Prix unitaire</th>
<th>Moyen de paiement</th> <th>Moyen de paiement</th>
<th>Date</th> <th>Date</th>
<th></th>
</tr> </tr>
</thead> </thead>
{% for facture in facture_list %} {% for facture in facture_list %}
@ -23,6 +24,7 @@
<td>{{ facture.prix }}</td> <td>{{ facture.prix }}</td>
<td>{{ facture.paiement }}</td> <td>{{ facture.paiement }}</td>
<td>{{ facture.date }}</td> <td>{{ facture.date }}</td>
<td><a href="{% url 'cotisations:edit-facture' facture.id %}">Editer</a></td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>

BIN
users/__pycache__/models.cpython-34.pyc

Binary file not shown.

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

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

BIN
users/migrations/__pycache__/0007_auto_20160702_2322.cpython-34.pyc

Binary file not shown.

BIN
users/migrations/__pycache__/0008_user_registered.cpython-34.pyc

Binary file not shown.

4
users/models.py

@ -21,6 +21,7 @@ class User(models.Model):
pwd_ssha = models.CharField(max_length=255) pwd_ssha = models.CharField(max_length=255)
pwd_ntlm = models.CharField(max_length=255) pwd_ntlm = models.CharField(max_length=255)
state = models.IntegerField(choices=STATES, default=STATE_ACTIVE) state = models.IntegerField(choices=STATES, default=STATE_ACTIVE)
registered = models.DateTimeField(auto_now_add=True)
def __str__(self): def __str__(self):
return self.pseudo return self.pseudo
@ -50,7 +51,7 @@ class ListRight(models.Model):
class Ban(models.Model): class Ban(models.Model):
user = models.ForeignKey('User', on_delete=models.PROTECT) user = models.ForeignKey('User', on_delete=models.PROTECT)
raison = models.CharField(max_length=255) 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') date_end = models.DateTimeField(help_text='%m/%d/%y %H:%M:%S')
def __str__(self): def __str__(self):
@ -113,7 +114,6 @@ class DelRightForm(ModelForm):
class BanForm(ModelForm): class BanForm(ModelForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(BanForm, self).__init__(*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' self.fields['date_end'].label = 'Date de fin'
class Meta: class Meta:

2
users/templates/users/index.html

@ -10,6 +10,7 @@
<th>Prénom</th> <th>Prénom</th>
<th>Nom</th> <th>Nom</th>
<th>Pseudo</th> <th>Pseudo</th>
<th>Inscrit le</th>
<th>Modifier</th> <th>Modifier</th>
</tr> </tr>
</thead> </thead>
@ -18,6 +19,7 @@
<td>{{ user.name }}</td> <td>{{ user.name }}</td>
<td>{{ user.surname }}</td> <td>{{ user.surname }}</td>
<td>{{ user.pseudo }}</td> <td>{{ user.pseudo }}</td>
<td>{{ user.registered }}</td>
<td><a href="{% url 'users:edit-info' user.id %}">Editer</a></td> <td><a href="{% url 'users:edit-info' user.id %}">Editer</a></td>
</tr> </tr>
{% endfor %} {% endfor %}

Loading…
Cancel
Save