mirror of
https://github.com/nanoy42/coope
synced 2024-11-22 03:13:12 +00:00
Add reason field on whitelists
This commit is contained in:
parent
188b278532
commit
9ba037ec12
5 changed files with 32 additions and 3 deletions
|
@ -50,9 +50,9 @@ class WhiteListHistoryAdmin(SimpleHistoryAdmin):
|
|||
"""
|
||||
The admin class for :class:`Consumptions <users.models.WhiteListHistory>`.
|
||||
"""
|
||||
list_display = ('user', 'paymentDate', 'endDate', 'duration')
|
||||
list_display = ('user', 'paymentDate', 'endDate', 'duration', 'reason')
|
||||
ordering = ('user', 'duration', 'paymentDate', 'endDate')
|
||||
search_fields = ('user__username', 'user__first_name', 'user__last_name')
|
||||
search_fields = ('user__username', 'user__first_name', 'user__last_name', 'reason')
|
||||
|
||||
admin.site.register(Permission, SimpleHistoryAdmin)
|
||||
admin.site.register(School, SimpleHistoryAdmin)
|
||||
|
|
|
@ -99,7 +99,7 @@ class addWhiteListHistoryForm(forms.ModelForm):
|
|||
"""
|
||||
class Meta:
|
||||
model = WhiteListHistory
|
||||
fields = ("duration", )
|
||||
fields = ("duration", "reason")
|
||||
|
||||
class SchoolForm(forms.ModelForm):
|
||||
"""
|
||||
|
|
23
users/migrations/0008_auto_20190623_1105.py
Normal file
23
users/migrations/0008_auto_20190623_1105.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 2.1 on 2019-06-23 09:05
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0007_auto_20190623_0957'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='historicalwhitelisthistory',
|
||||
name='reason',
|
||||
field=models.CharField(blank=True, max_length=255, verbose_name='Raison'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='whitelisthistory',
|
||||
name='reason',
|
||||
field=models.CharField(blank=True, max_length=255, verbose_name='Raison'),
|
||||
),
|
||||
]
|
|
@ -99,6 +99,10 @@ class WhiteListHistory(models.Model):
|
|||
"""
|
||||
User (:class:`django.contrib.auth.models.User`) who registered the cotisation.
|
||||
"""
|
||||
reason = models.CharField(max_length=255, verbose_name="Raison", blank=True)
|
||||
"""
|
||||
Reason of the whitelist
|
||||
"""
|
||||
history = HistoricalRecords()
|
||||
|
||||
class Profile(models.Model):
|
||||
|
|
|
@ -263,6 +263,7 @@
|
|||
<th>Date de l'ajout</th>
|
||||
<th>Date de fin</th>
|
||||
<th>Durée</th>
|
||||
<th>Raison</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -271,6 +272,7 @@
|
|||
<td>{{whitelist.paymentDate}}</td>
|
||||
<td>{{whitelist.endDate}}</td>
|
||||
<td>{{whitelist.duration}} jours</td>
|
||||
<td>{{ whitelist.reason }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in a new issue