From 2cb9ccd0f80b0c54df4d4cfba7cc43708b3ce680 Mon Sep 17 00:00:00 2001 From: chirac Date: Tue, 5 Jul 2016 12:21:43 +0200 Subject: [PATCH] Attribut active/inactive sur une machine --- cotisations/admin.py | 4 ++-- machines/admin.py | 2 +- .../migrations/0013_auto_20160705_1014.py | 24 +++++++++++++++++++ machines/models.py | 1 + 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 machines/migrations/0013_auto_20160705_1014.py diff --git a/cotisations/admin.py b/cotisations/admin.py index 03a7efbe..40b04591 100644 --- a/cotisations/admin.py +++ b/cotisations/admin.py @@ -3,10 +3,10 @@ from django.contrib import admin from .models import Facture, Article, Banque, Paiement, Cotisation class FactureAdmin(admin.ModelAdmin): - list_display = ('user','paiement','name', 'number', 'date') + list_display = ('user','paiement','name', 'number','prix', 'date','valid') class ArticleAdmin(admin.ModelAdmin): - list_display = ('name','prix','cotisation') + list_display = ('name','prix','cotisation','duration') class BanqueAdmin(admin.ModelAdmin): list_display = ('name',) diff --git a/machines/admin.py b/machines/admin.py index 5931c99d..0122d746 100644 --- a/machines/admin.py +++ b/machines/admin.py @@ -3,7 +3,7 @@ from django.contrib import admin from .models import Machine, MachineType, IpList, Interface class MachineAdmin(admin.ModelAdmin): - list_display = ('user','name','type') + list_display = ('user','name','type','active') class MachineTypeAdmin(admin.ModelAdmin): list_display = ('type',) diff --git a/machines/migrations/0013_auto_20160705_1014.py b/machines/migrations/0013_auto_20160705_1014.py new file mode 100644 index 00000000..68b67758 --- /dev/null +++ b/machines/migrations/0013_auto_20160705_1014.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('machines', '0012_auto_20160704_0118'), + ] + + operations = [ + migrations.AddField( + model_name='machine', + name='active', + field=models.BooleanField(default=True), + ), + migrations.AlterField( + model_name='interface', + name='dns', + field=models.CharField(max_length=255, unique=True, help_text='Obligatoire et unique, doit se terminer en .rez et ne pas comporter de points'), + ), + ] diff --git a/machines/models.py b/machines/models.py index 778a83fb..0276785c 100644 --- a/machines/models.py +++ b/machines/models.py @@ -8,6 +8,7 @@ class Machine(models.Model): user = models.ForeignKey('users.User', on_delete=models.PROTECT) type = models.ForeignKey('MachineType', on_delete=models.PROTECT) name = models.CharField(max_length=255, help_text="Optionnel", blank=True, null=True) + active = models.BooleanField(default=True) def __str__(self): return str(self.user) + ' - ' + str(self.id) + ' - ' + str(self.name)