0001_initial.py 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import models, migrations
  4. import mezzanine.core.fields
  5. import mezzanine.utils.models
  6. from django.conf import settings
  7. class Migration(migrations.Migration):
  8. dependencies = [
  9. ('sites', '0001_initial'),
  10. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  11. ]
  12. operations = [
  13. migrations.CreateModel(
  14. name='BlogCategory',
  15. fields=[
  16. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  17. ('title', models.CharField(max_length=500, verbose_name='Title')),
  18. ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)),
  19. ('site', models.ForeignKey(editable=False, to='sites.Site')),
  20. ],
  21. options={
  22. 'ordering': ('title',),
  23. 'verbose_name': 'Blog Category',
  24. 'verbose_name_plural': 'Blog Categories',
  25. },
  26. bases=(models.Model,),
  27. ),
  28. migrations.CreateModel(
  29. name='BlogPost',
  30. fields=[
  31. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  32. ('comments_count', models.IntegerField(default=0, editable=False)),
  33. ('keywords_string', models.CharField(max_length=500, editable=False, blank=True)),
  34. ('rating_count', models.IntegerField(default=0, editable=False)),
  35. ('rating_sum', models.IntegerField(default=0, editable=False)),
  36. ('rating_average', models.FloatField(default=0, editable=False)),
  37. ('title', models.CharField(max_length=500, verbose_name='Title')),
  38. ('slug', models.CharField(help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL', blank=True)),
  39. ('_meta_title', models.CharField(help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title', blank=True)),
  40. ('description', models.TextField(verbose_name='Description', blank=True)),
  41. ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')),
  42. ('created', models.DateTimeField(null=True, editable=False)),
  43. ('updated', models.DateTimeField(null=True, editable=False)),
  44. ('status', models.IntegerField(default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status', choices=[(1, 'Draft'), (2, 'Published')])),
  45. ('publish_date', models.DateTimeField(help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from', blank=True)),
  46. ('expiry_date', models.DateTimeField(help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on', blank=True)),
  47. ('short_url', models.URLField(null=True, blank=True)),
  48. ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')),
  49. ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
  50. ('allow_comments', models.BooleanField(default=True, verbose_name='Allow comments')),
  51. ('featured_image', mezzanine.core.fields.FileField(max_length=255, null=True, verbose_name='Featured Image', blank=True)),
  52. ('categories', models.ManyToManyField(related_name='blogposts', verbose_name='Categories', to='blog.BlogCategory', blank=True)),
  53. ('related_posts', models.ManyToManyField(related_name='related_posts_rel_+', verbose_name='Related posts', to='blog.BlogPost', blank=True)),
  54. ('site', models.ForeignKey(editable=False, to='sites.Site')),
  55. ('user', models.ForeignKey(related_name='blogposts', verbose_name='Author', to=settings.AUTH_USER_MODEL)),
  56. ],
  57. options={
  58. 'ordering': ('-publish_date',),
  59. 'verbose_name': 'Blog post',
  60. 'verbose_name_plural': 'Blog posts',
  61. },
  62. bases=(models.Model, mezzanine.utils.models.AdminThumbMixin),
  63. ),
  64. ]