~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to wlimages/migrations/0001_initial.py

  • Committer: franku
  • Date: 2016-07-02 12:38:06 UTC
  • mfrom: (404.2.56 widelands)
  • Revision ID: somal@arcor.de-20160702123806-q69u3d48s1prrxds
merged the django1_8 branch

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
import datetime
 
6
from django.conf import settings
 
7
 
 
8
 
 
9
class Migration(migrations.Migration):
 
10
 
 
11
    dependencies = [
 
12
        ('contenttypes', '0002_remove_content_type_name'),
 
13
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
 
14
    ]
 
15
 
 
16
    operations = [
 
17
        migrations.CreateModel(
 
18
            name='Image',
 
19
            fields=[
 
20
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
 
21
                ('object_id', models.PositiveIntegerField()),
 
22
                ('name', models.CharField(max_length=100)),
 
23
                ('revision', models.PositiveIntegerField()),
 
24
                ('editor_ip', models.GenericIPAddressField(null=True, verbose_name='IP address', blank=True)),
 
25
                ('date_submitted', models.DateTimeField(default=datetime.datetime.now, verbose_name='date/time submitted')),
 
26
                ('image', models.ImageField(upload_to=b'wlimages/')),
 
27
                ('url', models.CharField(max_length=250)),
 
28
                ('content_type', models.ForeignKey(to='contenttypes.ContentType')),
 
29
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
 
30
            ],
 
31
            options={
 
32
                'ordering': ('-date_submitted',),
 
33
                'get_latest_by': 'date_submitted',
 
34
                'verbose_name': 'Image',
 
35
                'verbose_name_plural': 'Images',
 
36
            },
 
37
        ),
 
38
    ]