8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-24 16:03:47 +00:00

Attribut active/inactive sur une machine

This commit is contained in:
chirac 2016-07-05 12:21:43 +02:00
parent 036c4fc774
commit 2cb9ccd0f8
4 changed files with 28 additions and 3 deletions

View file

@ -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',)

View file

@ -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',)

View file

@ -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'),
),
]

View file

@ -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)