0001_initial.py 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import models, migrations
  4. from django.conf import settings
  5. import hardware_provisioning.fields
  6. class Migration(migrations.Migration):
  7. dependencies = [
  8. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name='Item',
  13. fields=[
  14. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  15. ('designation', models.CharField(max_length=100, verbose_name='d\xe9signation')),
  16. ('mac_address', hardware_provisioning.fields.MACAddressField(max_length=17, null=True, verbose_name='addresse MAC', blank=True)),
  17. ('buy_date', models.DateTimeField(verbose_name='date d\u2019achat')),
  18. ('comment', models.TextField(null=True, verbose_name='commentaire', blank=True)),
  19. ],
  20. options={
  21. 'verbose_name': 'objet',
  22. },
  23. bases=(models.Model,),
  24. ),
  25. migrations.CreateModel(
  26. name='ItemType',
  27. fields=[
  28. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  29. ('name', models.CharField(max_length=100, verbose_name='nom')),
  30. ],
  31. options={
  32. 'verbose_name': 'type d\u2019objet',
  33. 'verbose_name_plural': 'types d\u2019objet',
  34. },
  35. bases=(models.Model,),
  36. ),
  37. migrations.CreateModel(
  38. name='Loan',
  39. fields=[
  40. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  41. ('loan_date', models.DateTimeField(verbose_name='date de pr\xeat')),
  42. ('loan_date_end', models.DateTimeField(null=True, verbose_name='date de fin de pr\xeat', blank=True)),
  43. ('location', models.CharField(max_length=100, null=True, verbose_name='emplacement', blank=True)),
  44. ('item', models.ForeignKey(related_name='loans', verbose_name='objet', to='hardware_provisioning.Item')),
  45. ('user', models.ForeignKey(related_name='loans', verbose_name='membre', to=settings.AUTH_USER_MODEL)),
  46. ],
  47. options={
  48. 'verbose_name': 'pr\xeat d\u2019objet',
  49. 'verbose_name_plural': 'pr\xeats d\u2019objets',
  50. },
  51. bases=(models.Model,),
  52. ),
  53. migrations.AddField(
  54. model_name='item',
  55. name='type',
  56. field=models.ForeignKey(related_name='items', verbose_name='type de mat\xe9riel', to='hardware_provisioning.ItemType'),
  57. preserve_default=True,
  58. ),
  59. migrations.AddField(
  60. model_name='item',
  61. name='user_in_charge',
  62. field=models.ForeignKey(related_name='items', verbose_name='membre responsable', to=settings.AUTH_USER_MODEL),
  63. preserve_default=True,
  64. ),
  65. ]