class Migration(migrations.Migration):

    dependencies = [
        ('cars', '0011_remove_car_slot_number'),
    ]

    operations = [
        migrations.AddField(
            model_name='car',
            name='slot_number',
            field=models.IntegerField(blank=True, default=cars.models.get_slot_number, null=True),
        ),
    ]
Ejemplo n.º 2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Cars',
            fields=[
                ('cars_id', models.AutoField(primary_key=True,
                                             serialize=False)),
                ('brand', models.CharField(max_length=50)),
                ('model', models.CharField(max_length=50)),
                ('year',
                 models.IntegerField(validators=[
                     django.core.validators.MinValueValidator(1984),
                     cars.models.max_value_current_year
                 ],
                                     verbose_name='year')),
                ('color', models.CharField(max_length=50)),
                ('price', models.FloatField()),
                ('condition',
                 models.CharField(choices=[('N', 'New'), ('T', 'Tokunbo'),
                                           ('NU', 'Nigerian Use')],
                                  max_length=2)),
                ('fuel_type',
                 models.CharField(choices=[('P', 'Petrol'), ('D', 'Diesel'),
                                           ('E', 'Electric')],
                                  max_length=1,
                                  verbose_name='fuel type')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=cars.models.upload_location)),
                ('date_uploaded',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='date uploaded')),
                ('date_updated',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='date updated')),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('seller',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('cars', '0007_auto_20170617_1801'),
    ]

    operations = [
        migrations.AlterField(
            model_name='car',
            name='slot_number',
            field=models.IntegerField(blank=True,
                                      default=cars.models.get_slot_number,
                                      null=True),
        ),
    ]
Ejemplo n.º 4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Car',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('condition', models.CharField(max_length=45)),
                ('year', models.IntegerField()),
                ('trim', models.CharField(max_length=45)),
                ('car_model', models.CharField(max_length=45)),
                ('body_style', models.CharField(max_length=45)),
                ('transmission', models.IntegerField()),
                ('fuel', models.CharField(max_length=45)),
                ('feature', models.TextField()),
                ('cylinder', models.IntegerField()),
                ('color_internal', models.CharField(max_length=45)),
                ('color_external', models.CharField(max_length=45)),
                ('price', models.CharField(max_length=45)),
                ('kilometer', models.IntegerField()),
                ('car_brand', models.CharField(max_length=45)),
                ('describe', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Car_brand',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
            ],
        ),
        migrations.CreateModel(
            name='Car_image',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(upload_to=cars.models.car_directory_path)),
                ('car',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='cars.Car')),
            ],
        ),
        migrations.CreateModel(
            name='Car_model',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
                ('brand',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='cars.Car_brand')),
            ],
        ),
        migrations.CreateModel(
            name='City',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
            ],
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=45)),
                ('currency_unit', models.CharField(max_length=45)),
            ],
        ),
        migrations.CreateModel(
            name='Seller',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('full_name', models.CharField(max_length=45)),
                ('phone_number', models.CharField(max_length=45)),
                ('location_pin', models.CharField(max_length=45)),
                ('address', models.CharField(max_length=255)),
                ('type', models.BooleanField(default=True)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('update_time', models.DateTimeField(auto_now=True)),
                ('city',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='cars.City')),
                ('country',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='cars.Country')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='city',
            name='country',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='cars.Country'),
        ),
        migrations.AddField(
            model_name='car',
            name='city',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='cars.City'),
        ),
        migrations.AddField(
            model_name='car',
            name='country',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='cars.Country'),
        ),
        migrations.AddField(
            model_name='car',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='cars.Seller'),
        ),
    ]
Ejemplo n.º 5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Brand',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
                ('image',
                 models.ImageField(blank=True, null=True,
                                   upload_to='brands/')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('slug',
                 autoslug.fields.AutoSlugField(
                     editable=False,
                     populate_from='name',
                     slugify=cars.models.custom_slugify,
                     unique_with=('created_at__month', ))),
            ],
        ),
        migrations.CreateModel(
            name='Car',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=200, null=True)),
                ('price', models.FloatField()),
                ('image', models.ImageField(upload_to='cars/')),
                ('description', models.TextField(null=True)),
                ('views', models.PositiveIntegerField(default=0)),
                ('featured', models.PositiveIntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('slug',
                 autoslug.fields.AutoSlugField(
                     editable=False,
                     populate_from='title',
                     slugify=cars.models.custom_slugify,
                     unique_with=('created_at__month', ))),
                ('region',
                 models.CharField(blank=True,
                                  choices=[('ashanti', 'Ashanti'),
                                           ('ahafo', 'Ahafo'),
                                           ('brong-ahafo', 'Brong Ahafo'),
                                           ('bono-east', 'Bono East '),
                                           ('central', 'Central'),
                                           ('eastern', 'Eastern'),
                                           ('greater-accra', 'Greater Accra'),
                                           ('northern', 'Northern'),
                                           ('savannah', 'Savannah'),
                                           ('north-east', 'North East'),
                                           ('upper-east', 'Upper East'),
                                           ('upper-west', 'Upper West'),
                                           ('volta', 'Volta'),
                                           ('oti', 'Oti Region'),
                                           ('werstern', 'Western'),
                                           ('werstern-north', 'Western North')
                                           ],
                                  max_length=20,
                                  null=True)),
                ('int_color',
                 colorfield.fields.ColorField(blank=True,
                                              default='#FFFFFF',
                                              max_length=18,
                                              null=True)),
                ('ext_color',
                 colorfield.fields.ColorField(blank=True,
                                              default='#FFFFFF',
                                              max_length=18,
                                              null=True)),
                ('mileage',
                 models.CharField(blank=True, max_length=200, null=True)),
                ('fuel_type',
                 models.CharField(blank=True,
                                  choices=[('petrol', 'Petrol'),
                                           ('diesel', 'Diesel'),
                                           ('gas', 'Gas')],
                                  max_length=6,
                                  null=True)),
                ('gearbox',
                 models.CharField(blank=True,
                                  choices=[('automatic', 'Automatic'),
                                           ('manual', 'Manual')],
                                  max_length=10,
                                  null=True)),
                ('drive_type',
                 models.CharField(blank=True,
                                  choices=[('left', 'Left'),
                                           ('right', 'Right')],
                                  max_length=5,
                                  null=True)),
                ('car_state',
                 models.CharField(choices=[('new', 'New'), ('used', 'Used')],
                                  max_length=4,
                                  null=True)),
                ('engine',
                 models.CharField(blank=True, max_length=200, null=True)),
                ('air_con',
                 models.CharField(blank=True,
                                  choices=[('no', 'No'), ('yes', 'Yes')],
                                  max_length=3,
                                  null=True)),
                ('year',
                 models.IntegerField(validators=[
                     django.core.validators.MinValueValidator(1984),
                     cars.models.max_value_current_year
                 ],
                                     verbose_name='year')),
                ('brand',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='carbrands',
                     to='cars.Brand')),
            ],
        ),
        migrations.CreateModel(
            name='CarImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('images',
                 models.ImageField(blank=True, null=True, upload_to='cars')),
                ('car',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='carimages',
                                   to='cars.Car')),
            ],
        ),
    ]