~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to news/migrations/0001_initial.py

  • Committer: Holger Rapp
  • Date: 2009-02-19 15:31:42 UTC
  • Revision ID: sirver@h566336-20090219153142-dc8xuabldnw5t395
Initial commit of new widelands homepage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: utf-8 -*-
2
 
from __future__ import unicode_literals
3
 
 
4
 
from django.db import models, migrations
5
 
from django.conf import settings
6
 
import news.models
7
 
import tagging.fields
8
 
 
9
 
 
10
 
class Migration(migrations.Migration):
11
 
 
12
 
    dependencies = [
13
 
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
14
 
    ]
15
 
 
16
 
    operations = [
17
 
        migrations.CreateModel(
18
 
            name='Category',
19
 
            fields=[
20
 
                ('id', models.AutoField(verbose_name='ID',
21
 
                                        serialize=False, auto_created=True, primary_key=True)),
22
 
                ('title', models.CharField(max_length=100, verbose_name='title')),
23
 
                ('slug', models.SlugField(unique=True, verbose_name='slug')),
24
 
                ('image', models.ImageField(upload_to=news.models.get_upload_name)),
25
 
            ],
26
 
            options={
27
 
                'ordering': ('title',),
28
 
                'db_table': 'news_categories',
29
 
                'verbose_name': 'category',
30
 
                'verbose_name_plural': 'categories',
31
 
            },
32
 
        ),
33
 
        migrations.CreateModel(
34
 
            name='Post',
35
 
            fields=[
36
 
                ('id', models.AutoField(verbose_name='ID',
37
 
                                        serialize=False, auto_created=True, primary_key=True)),
38
 
                ('title', models.CharField(max_length=200, verbose_name='title')),
39
 
                ('slug', models.SlugField(
40
 
                    verbose_name='slug', unique_for_date=b'publish')),
41
 
                ('body', models.TextField(verbose_name='body')),
42
 
                ('tease', models.TextField(verbose_name='tease', blank=True)),
43
 
                ('status', models.IntegerField(
44
 
                    default=2, verbose_name='status', choices=[(1, 'Draft'), (2, 'Public')])),
45
 
                ('allow_comments', models.BooleanField(
46
 
                    default=True, verbose_name='allow comments')),
47
 
                ('publish', models.DateTimeField(verbose_name='publish')),
48
 
                ('created', models.DateTimeField(
49
 
                    auto_now_add=True, verbose_name='created')),
50
 
                ('modified', models.DateTimeField(
51
 
                    auto_now=True, verbose_name='modified')),
52
 
                ('tags', tagging.fields.TagField(max_length=255, blank=True)),
53
 
                ('author', models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True)),
54
 
                ('categories', models.ManyToManyField(
55
 
                    to='news.Category', blank=True)),
56
 
            ],
57
 
            options={
58
 
                'ordering': ('-publish',),
59
 
                'db_table': 'news_posts',
60
 
                'verbose_name': 'post',
61
 
                'verbose_name_plural': 'posts',
62
 
                'get_latest_by': 'publish',
63
 
            },
64
 
        ),
65
 
    ]