Exemplo n.º 1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Device',
            fields=[
                ('identifier', device.models.RandomIdentifierField(default=device.models.GenerateIdentifier(16, '0123456789ABCDEF'), help_text='Device identifier', max_length=16, primary_key=True, serialize=False)),
                ('realm', models.CharField(help_text='Device realm', max_length=8)),
                ('user', models.CharField(help_text='Device user', max_length=8)),
                ('creation_date', models.DateTimeField(auto_now_add=True, help_text='Creation date')),
                ('last_update', models.DateTimeField(auto_now=True, help_text='Last update')),
            ],
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('orchestrator', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Device',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('device_id', models.UUIDField(default=uuid.uuid4, help_text='Unique ID of the device', unique=True)),
                ('name', models.CharField(default=device.models.defaultName, help_text='Unique display name of the device', max_length=30, unique=True)),
                ('note', models.TextField(blank=True, help_text='Extra information about the device', null=True)),
            ],
            options={
                'permissions': (('use_device', 'Can use device'),),
            },
        ),
        migrations.CreateModel(
            name='Transport',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('transport_id', models.CharField(default=device.models.shortID, editable=False, help_text='Unique ID of the transport', max_length=30, unique=True)),
                ('host', models.CharField(default='127.0.0.1', help_text='Hostname/IP of the device', max_length=60)),
                ('port', models.IntegerField(default=8080, help_text='Port of the device')),
                ('exchange', models.CharField(default='exchange', help_text='Exchange for the specific device, only necessary for Pub/Sub protocols', max_length=30)),
                ('routing_key', models.CharField(default='routing_key', help_text='Routing Key for the specific device, only necessary for Pub/Sub protocols', max_length=30)),
                ('protocol', models.ForeignKey(help_text='Protocol supported by the device', on_delete=django.db.models.deletion.CASCADE, to='orchestrator.Protocol')),
                ('serialization', models.ManyToManyField(help_text='Serialization(s) supported by the device', to='orchestrator.Serialization')),
            ],
        ),
        migrations.CreateModel(
            name='DeviceGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Unique display name of the device group', max_length=80, unique=True)),
                ('devices', models.ManyToManyField(blank=True, help_text='Devices available to users in the group', to='device.Device')),
                ('users', models.ManyToManyField(blank=True, help_text='Users in the group', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'group',
                'verbose_name_plural': 'groups',
            },
        ),
        migrations.AddField(
            model_name='device',
            name='transport',
            field=models.ManyToManyField(help_text='Transports the device supports', to='device.Transport'),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('device', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='device',
            name='assigned_date',
            field=models.CharField(blank=True, default='04/09/2021', max_length=50, null=True, validators=[device.models.dateValidate], verbose_name='ASSIGNED DATE'),
        ),
        migrations.AlterField(
            model_name='device',
            name='imei',
            field=models.BigIntegerField(unique=True, validators=[device.models.validate_imei], verbose_name='IMEI'),
        ),
    ]
Exemplo n.º 4
0
class Migration(migrations.Migration):

    dependencies = [
        ('device', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Motor',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('tag', models.CharField(max_length=30, unique=True)),
                ('motor',
                 models.CharField(blank=True,
                                  max_length=50,
                                  unique=True,
                                  verbose_name='Motor')),
                ('Fuel',
                 models.CharField(max_length=50,
                                  unique=True,
                                  verbose_name='Fuel')),
                ('Power', models.CharField(max_length=40)),
                ('Controller', models.CharField(max_length=10)),
                ('Type', models.CharField(blank=True, max_length=30)),
                ('Capacity', models.CharField(max_length=50)),
                ('image',
                 stdimage.models.StdImageField(
                     default='device/LogoSmart320.png',
                     upload_to=device.models.get_file_path,
                     verbose_name='Image')),
                ('year',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
            ],
        ),
    ]
Exemplo n.º 5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='oem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='model',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('oem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='device.oem')),
            ],
            options={
                'unique_together': {('oem', 'name')},
            },
        ),
        migrations.CreateModel(
            name='device',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('imei', models.IntegerField(unique=True, validators=[device.models.validate_imei], verbose_name='IMEI')),
                ('wfi_mac', models.CharField(blank=True, max_length=225, null=True, verbose_name='WFI MAC')),
                ('iccid', models.CharField(blank=True, max_length=225, null=True, verbose_name='ICCID')),
                ('imsi', models.CharField(blank=True, max_length=225, null=True, verbose_name='IMSI')),
                ('mdn', models.CharField(blank=True, max_length=225, null=True, verbose_name='MDN')),
                ('assignee', models.CharField(blank=True, default=None, max_length=225, null=True, verbose_name='ASSIGNEE')),
                ('assigned_date', models.CharField(blank=True, default='04/08/2021', max_length=50, null=True, validators=[device.models.dateValidate], verbose_name='ASSIGNED DATE')),
                ('purpose', models.CharField(blank=True, max_length=225, null=True, verbose_name='PURPOSE')),
                ('return_date', models.CharField(blank=True, max_length=50, null=True, validators=[device.models.dateValidate], verbose_name='RETURN DATE')),
                ('comment', models.TextField(blank=True, null=True, verbose_name='COMMENT')),
                ('delivery', models.CharField(choices=[('Early Dev Samples', 'Early Dev Samples'), ('Pre-LE', 'Pre-LE'), ('LE', 'LE'), ('FAI', 'FAI'), ('FFW', 'FFW'), ('VIP KIT', 'VIP KIT')], default=('Early Dev Samples', 'Early Dev Samples'), max_length=225, verbose_name='DELIVERY')),
                ('model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='device.model', verbose_name='MODEL')),
                ('oem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='device.oem', verbose_name='OEM')),
            ],
        ),
    ]