mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Attribut active/inactive sur une machine
This commit is contained in:
parent
036c4fc774
commit
2cb9ccd0f8
4 changed files with 28 additions and 3 deletions
|
@ -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',)
|
||||
|
|
24
machines/migrations/0013_auto_20160705_1014.py
Normal file
24
machines/migrations/0013_auto_20160705_1014.py
Normal 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'),
|
||||
),
|
||||
]
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue