poulpe/equipment/migrations/0001_initial.py

71 lines
3.2 KiB
Python
Raw Normal View History

2017-02-21 21:16:50 +01:00
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-18 17:05
2017-02-21 21:16:50 +01:00
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('event', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Equipment',
2017-02-21 21:16:50 +01:00
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
2017-07-18 15:37:13 +02:00
('name', models.CharField(max_length=200, verbose_name='nom du matériel')),
('stock', models.PositiveSmallIntegerField(verbose_name='quantité disponible')),
('description', models.TextField(verbose_name='description')),
2017-02-21 21:16:50 +01:00
],
options={
'verbose_name_plural': 'matériels permanents',
'verbose_name': 'matériel permanent',
2017-02-21 21:16:50 +01:00
},
),
migrations.CreateModel(
name='EquipmentAttribution',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
2017-07-18 15:37:13 +02:00
('amount', models.PositiveSmallIntegerField(verbose_name='quantité attribuée')),
('remarks', models.TextField(verbose_name="remarques concernant l'attribution")),
2017-02-21 21:16:50 +01:00
('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='event.Activity')),
('equipment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='equipment.Equipment')),
2017-02-21 21:16:50 +01:00
],
options={
'verbose_name_plural': 'attributions de matériel',
'verbose_name': 'attribution de matériel',
2017-02-21 21:16:50 +01:00
},
),
migrations.CreateModel(
name='EquipmentRemark',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
2017-07-18 15:37:13 +02:00
('remark', models.TextField(verbose_name='remarque sur le matériel')),
('amount', models.PositiveSmallIntegerField(verbose_name='quantité concernée')),
2017-02-21 21:16:50 +01:00
('is_broken', models.BooleanField()),
('is_lost', models.BooleanField()),
('equipment', models.ForeignKey(help_text='Matériel concerné par la remarque', on_delete=django.db.models.deletion.CASCADE, related_name='remarks', to='equipment.Equipment')),
2017-02-21 21:16:50 +01:00
],
options={
'verbose_name_plural': 'remarques sur le matériel',
'verbose_name': 'remarque sur matériel',
2017-02-21 21:16:50 +01:00
},
),
migrations.AddField(
model_name='equipment',
2017-02-21 21:16:50 +01:00
name='activities',
field=models.ManyToManyField(related_name='equipment', through='equipment.EquipmentAttribution', to='event.Activity'),
),
migrations.AddField(
model_name='equipment',
name='event',
field=models.ForeignKey(blank=True, help_text="Si spécifié, l'instance du modèleest spécifique à l'évènement en question", null=True, on_delete=django.db.models.deletion.CASCADE, to='event.Event', verbose_name='évènement'),
),
2017-02-21 21:16:50 +01:00
]