0001_initial.py 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import migrations, models
  4. from django.conf import settings
  5. class Migration(migrations.Migration):
  6. dependencies = [
  7. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  8. ]
  9. operations = [
  10. migrations.CreateModel(
  11. name='MaillingList',
  12. fields=[
  13. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  14. ('short_name', models.CharField(help_text='c\'est l\'identifiant qui servira \xe0 communiquer avec le syst\xe8me de mailling-list(typiquement, la partie avant le "@" dans l\'adress )', max_length=50, verbose_name='identifiant technique')),
  15. ('email', models.EmailField(max_length=254, verbose_name="adresse mail d'envoi")),
  16. ('verbose_name', models.CharField(help_text="Nom affich\xe9 dans l'interface membre", max_length=130, verbose_name='nom complet')),
  17. ('description', models.TextField()),
  18. ],
  19. options={
  20. 'verbose_name': 'liste mail',
  21. 'verbose_name_plural': 'listes mail',
  22. },
  23. ),
  24. migrations.CreateModel(
  25. name='MaillingListSubscription',
  26. fields=[
  27. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  28. ('maillinglist', models.ForeignKey(to='maillists.MaillingList')),
  29. ('member', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
  30. ],
  31. options={
  32. 'verbose_name': 'abonnement \xe0 une liste mail',
  33. 'verbose_name_plural': 'abonnements \xe0 des listes mail',
  34. },
  35. ),
  36. migrations.AddField(
  37. model_name='maillinglist',
  38. name='subscribers',
  39. field=models.ManyToManyField(related_name='subscribed_maillinglists', verbose_name='abonn\xe9\xb7e\xb7s', to=settings.AUTH_USER_MODEL, through='maillists.MaillingListSubscription', blank=True),
  40. ),
  41. ]