Commit 2cb9ccd0 authored by chirac's avatar chirac

Attribut active/inactive sur une machine

parent 036c4fc7
......@@ -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',)
......
......@@ -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',)
......
# -*- 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'),
),
]
......@@ -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)
......
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