# Generated by Django 3.1.2 on 2021-01-31 16:33

import cloudinary.models
from django.conf import settings
import django.contrib.gis.db.models.fields
import django.contrib.gis.geos.point
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('location', django.contrib.gis.db.models.fields.PointField(blank=True, default=django.contrib.gis.geos.point.Point(), null=True, srid=4326)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.CharField(max_length=255)),
                ('slug', models.CharField(blank=True, max_length=60, unique=True)),
                ('status', models.CharField(choices=[('E', 'Eladó'), ('K', 'Kiadó')], max_length=1)),
            ],
            options={
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=120)),
                ('description', tinymce.models.HTMLField()),
                ('slug', models.CharField(blank=True, max_length=60, unique=True)),
                ('data', models.JSONField()),
                ('status', models.CharField(choices=[('A', 'Active'), ('I', 'InActive'), ('S', 'Sold')], max_length=1)),
                ('date', models.DateField(auto_now=True)),
                ('address', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='House.address')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='House.category')),
            ],
            options={
                'verbose_name_plural': 'Properties',
                'ordering': ['-date'],
            },
        ),
        migrations.CreateModel(
            name='PropertyImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('images', cloudinary.models.CloudinaryField(max_length=255, verbose_name='image')),
                ('description', models.CharField(blank=True, default='', max_length=120)),
                ('property', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='House.property')),
            ],
        ),
    ]
