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

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('titulo', models.CharField(max_length=120)),
                ('slug', models.SlugField(unique=True)),
                ('imagen',
                 models.ImageField(blank=True,
                                   height_field='height_field',
                                   null=True,
                                   upload_to=apps.posts.models.upload_location,
                                   width_field='width_field')),
                ('height_field', models.IntegerField(default=0)),
                ('width_field', models.IntegerField(default=0)),
                ('contenido', models.TextField()),
                ('updated', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['-timestamp', '-updated'],
            },
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('description', models.TextField()),
                ('date_pub', models.DateTimeField(auto_now_add=True)),
                ('image',
                 models.ImageField(
                     null=True,
                     upload_to=apps.posts.models.upload_image_path)),
            ],
        ),
    ]
Exemplo n.º 3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('taggit', '0002_auto_20150616_2121'),
    ]

    operations = [
        migrations.CreateModel(
            name='Comentario',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('correo', models.EmailField(max_length=254)),
                ('contenido', models.TextField()),
                ('created', models.DateField(auto_now_add=True)),
                ('active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ('created', ),
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('titulo', models.CharField(max_length=250)),
                ('slug', models.SlugField(max_length=250, unique=True)),
                ('contenido',
                 ckeditor_uploader.fields.RichTextUploadingField()),
                ('publish',
                 models.DateField(default=django.utils.timezone.localtime)),
                ('created',
                 models.DateField(auto_now_add=True, verbose_name='creado')),
                ('updated', models.DateField(auto_now=True)),
                ('estado',
                 models.CharField(choices=[('borrador', 'Borrador'),
                                           ('publicado', 'Publicado')],
                                  default='borrador',
                                  max_length=10)),
                ('image',
                 models.ImageField(
                     blank=True,
                     upload_to=apps.posts.models.user_directory_path)),
                ('autor',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('tags',
                 taggit.managers.TaggableManager(
                     help_text='A comma-separated list of tags.',
                     through='taggit.TaggedItem',
                     to='taggit.Tag',
                     verbose_name='Tags')),
            ],
            options={
                'ordering': ('-publish', ),
            },
        ),
        migrations.AddField(
            model_name='comentario',
            name='post',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='comentarios',
                to='posts.Post'),
        ),
    ]
Exemplo n.º 4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [("contenttypes", "0002_remove_content_type_name")]

    operations = [
        migrations.CreateModel(
            name="Post",
            fields=[
                (
                    "id",
                    models.UUIDField(db_column="uuid",
                                     default=uuid.uuid4,
                                     editable=False,
                                     primary_key=True,
                                     serialize=False),
                ),
                (
                    "status",
                    models.CharField(
                        choices=[("deleted", "Deleted"),
                                 ("created", "Created"),
                                 ("approved", "Approved")],
                        default="created",
                        max_length=32,
                        verbose_name="Status",
                    ),
                ),
                ("created_date",
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name="Created date")),
                ("updated_date",
                 models.DateTimeField(auto_now=True,
                                      verbose_name="Updated date")),
                ("object_id",
                 models.UUIDField(null=True, verbose_name="Object UUID")),
                (
                    "theme",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("swing", "Swing"),
                            ("swing_history", "Swing History"),
                            ("bdsm", "Bdsm"),
                            ("bdsm_history", "Bdsm History"),
                            ("rule", "Rule"),
                            ("rule_media", "Rule Media"),
                            ("advertisment", "Advertisment"),
                        ],
                        max_length=64,
                        null=True,
                        verbose_name="Theme",
                    ),
                ),
                ("hash_tags",
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name="Hash tags")),
                ("likes",
                 models.PositiveIntegerField(default=0, verbose_name="Likes")),
                ("views",
                 models.PositiveIntegerField(default=0, verbose_name="Views")),
                ("title", models.CharField(max_length=255,
                                           verbose_name="Title")),
                ("description",
                 ckeditor.fields.RichTextField(verbose_name="Description")),
                ("post",
                 ckeditor_uploader.fields.RichTextUploadingField(
                     verbose_name="Post")),
                ("published_for_all",
                 models.BooleanField(default=False,
                                     verbose_name="Published for All")),
                (
                    "content_type",
                    models.ForeignKey(
                        limit_choices_to=apps.posts.models.
                        limit_choices_to_content_type,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.ContentType",
                        verbose_name="Content type",
                    ),
                ),
            ],
            options={
                "verbose_name": "post",
                "verbose_name_plural": "posts"
            },
        )
    ]
Exemplo n.º 5
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 imagekit.models.fields.ProcessedImageField(
                     upload_to=apps.posts.models.post_image_path)),
                ('content', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('like_users',
                 models.ManyToManyField(blank=True,
                                        related_name='like_posts',
                                        to=settings.AUTH_USER_MODEL)),
                ('user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='comment',
            name='post',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='posts.Post'),
        ),
        migrations.AddField(
            model_name='comment',
            name='user',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to=settings.AUTH_USER_MODEL),
        ),
    ]