class Migration(migrations.Migration):

    dependencies = [
        ('producto', '0004_auto_20171213_1550'),
    ]

    operations = [
        migrations.AlterField(
            model_name='producto',
            name='imagen',
            field=models.ImageField(
                upload_to=apps.producto.models.user_directory_path),
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='producto',
            name='imagen',
            field=models.ImageField(
                blank=True,
                null=True,
                upload_to=apps.producto.models.user_directory_path),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('producto', '0003_auto_20171213_1324'),
    ]

    operations = [
        migrations.AlterField(
            model_name='producto',
            name='imagen',
            field=models.ImageField(
                height_field=200,
                upload_to=apps.producto.models.user_directory_path,
                width_field=200),
        ),
    ]
Exemple #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Categoria',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Marca',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Modelo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
                ('marca',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='producto.Marca')),
            ],
        ),
        migrations.CreateModel(
            name='Producto',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('codigo', models.CharField(max_length=50, unique=True)),
                ('descripcion', models.CharField(max_length=500, unique=True)),
                ('precio', models.DecimalField(decimal_places=2,
                                               max_digits=14)),
                ('imagen',
                 models.ImageField(
                     height_field=200,
                     upload_to=apps.producto.models.user_directory_path,
                     width_field=200)),
                ('categoria',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='producto.Categoria')),
                ('modelo',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='producto.Modelo')),
            ],
        ),
    ]