0001_initial.py 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import models, migrations
  4. import coin.mixins
  5. import ldapdb.models.fields
  6. class Migration(migrations.Migration):
  7. dependencies = [
  8. ('configuration', '0003_configuration_comment'),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name='LdapDSLConfig',
  13. fields=[
  14. ('dn', models.CharField(max_length=200)),
  15. ('login', ldapdb.models.fields.CharField(max_length=255, serialize=False, primary_key=True, db_column=b'cn')),
  16. ('password', ldapdb.models.fields.CharField(max_length=255, db_column=b'userPassword')),
  17. ('cleartext_password', ldapdb.models.fields.CharField(max_length=255, db_column=b'description')),
  18. ('active', ldapdb.models.fields.CharField(max_length=3, db_column=b'dialupAccess')),
  19. ('ipv4_endpoint', ldapdb.models.fields.CharField(max_length=16, db_column=b'radiusFramedIPAddress')),
  20. ('ranges_v4', ldapdb.models.fields.ListField(db_column=b'radiusFramedRoute')),
  21. ('ranges_v6', ldapdb.models.fields.ListField(db_column=b'ipHostNumber')),
  22. ],
  23. options={
  24. 'managed': False,
  25. },
  26. bases=(models.Model,),
  27. ),
  28. migrations.CreateModel(
  29. name='DSLConfiguration',
  30. fields=[
  31. ('configuration_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='configuration.Configuration')),
  32. ('phone_number', models.CharField(help_text='Phone number associated to the DSL line', max_length=20, verbose_name='phone number')),
  33. ('activated', models.BooleanField(default=False, verbose_name='activated')),
  34. ('login', models.CharField(help_text='Leave empty for automatic generation', unique=True, max_length=50, verbose_name='login', blank=True)),
  35. ('password', models.CharField(help_text='Will be stored in cleartext! Automatically generated if empty', max_length=256, verbose_name='password', blank=True)),
  36. ],
  37. options={
  38. 'verbose_name': 'DSL line',
  39. 'verbose_name_plural': 'DSL lines',
  40. },
  41. bases=(coin.mixins.CoinLdapSyncMixin, 'configuration.configuration'),
  42. ),
  43. migrations.CreateModel(
  44. name='RadiusGroup',
  45. fields=[
  46. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  47. ('name', models.CharField(max_length=256, verbose_name='group name')),
  48. ('realm', models.CharField(help_text='Example: "fdn.nerim"', max_length=50, verbose_name='radius realm')),
  49. ('suffix', models.CharField(help_text='Optional suffix added to the login, as a kind of "sub-realm". Example: "%gnd"', max_length=50, verbose_name='suffix', blank=True)),
  50. ('comment', models.CharField(max_length=256, verbose_name='comment', blank=True)),
  51. ],
  52. options={
  53. 'verbose_name': 'radius group',
  54. 'verbose_name_plural': 'radius groups',
  55. },
  56. bases=(models.Model,),
  57. ),
  58. migrations.AddField(
  59. model_name='dslconfiguration',
  60. name='radius_group',
  61. field=models.ForeignKey(verbose_name='radius group', to='dsl_ldap.RadiusGroup', help_text='Group (i.e. backhaul) to use'),
  62. preserve_default=True,
  63. ),
  64. ]