0004_comment.py 1.3 KB

123456789101112131415161718192021222324252627282930
  1. # Generated by Django 4.1.4 on 2023-01-09 09:01
  2. from django.db import migrations, models
  3. import django.db.models.deletion
  4. class Migration(migrations.Migration):
  5. dependencies = [
  6. ('main', '0003_ad_alter_rubric_name_additionalimage'),
  7. ]
  8. operations = [
  9. migrations.CreateModel(
  10. name='Comment',
  11. fields=[
  12. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  13. ('author', models.CharField(max_length=30, verbose_name='Автор')),
  14. ('content', models.TextField(verbose_name='Комментарий')),
  15. ('is_active', models.BooleanField(db_index=True, default=True, verbose_name='Выводить на экран?')),
  16. ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Опубликован')),
  17. ('ad', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.ad', verbose_name='Объявление')),
  18. ],
  19. options={
  20. 'verbose_name': 'Комментарий',
  21. 'verbose_name_plural': 'Комментарии',
  22. 'ordering': ['created_at'],
  23. },
  24. ),
  25. ]