~widelands-dev/widelands-website/cleanup_ip_address_field

« back to all changes in this revision

Viewing changes to tracking/migrations/0001_initial.py

  • Committer: franku
  • Date: 2018-04-26 20:18:55 UTC
  • mfrom: (489.1.28 widelands)
  • Revision ID: somal@arcor.de-20180426201855-uwt3b8gptpav6wrm
updated code base to fit with django 1.11.12; replaced app tracking with a new middleware

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
 
 
7
 
 
8
 
class Migration(migrations.Migration):
9
 
 
10
 
    dependencies = [
11
 
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12
 
    ]
13
 
 
14
 
    operations = [
15
 
        migrations.CreateModel(
16
 
            name='BannedIP',
17
 
            fields=[
18
 
                ('id', models.AutoField(verbose_name='ID',
19
 
                                        serialize=False, auto_created=True, primary_key=True)),
20
 
                ('ip_address', models.GenericIPAddressField(
21
 
                    help_text='The IP address that should be banned', verbose_name=b'IP Address')),
22
 
            ],
23
 
            options={
24
 
                'ordering': ('ip_address',),
25
 
                'verbose_name': 'Banned IP',
26
 
                'verbose_name_plural': 'Banned IPs',
27
 
            },
28
 
        ),
29
 
        migrations.CreateModel(
30
 
            name='UntrackedUserAgent',
31
 
            fields=[
32
 
                ('id', models.AutoField(verbose_name='ID',
33
 
                                        serialize=False, auto_created=True, primary_key=True)),
34
 
                ('keyword', models.CharField(help_text='Part or all of a user-agent string.  For example, "Googlebot" here will be found in "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" and that visitor will not be tracked.', max_length=100, verbose_name='keyword')),
35
 
            ],
36
 
            options={
37
 
                'ordering': ('keyword',),
38
 
                'verbose_name': 'Untracked User-Agent',
39
 
                'verbose_name_plural': 'Untracked User-Agents',
40
 
            },
41
 
        ),
42
 
        migrations.CreateModel(
43
 
            name='Visitor',
44
 
            fields=[
45
 
                ('id', models.AutoField(verbose_name='ID',
46
 
                                        serialize=False, auto_created=True, primary_key=True)),
47
 
                ('session_key', models.CharField(max_length=40)),
48
 
                ('ip_address', models.CharField(max_length=20)),
49
 
                ('user_agent', models.CharField(max_length=255)),
50
 
                ('referrer', models.CharField(max_length=255)),
51
 
                ('url', models.CharField(max_length=255)),
52
 
                ('page_views', models.PositiveIntegerField(default=0)),
53
 
                ('session_start', models.DateTimeField()),
54
 
                ('last_update', models.DateTimeField()),
55
 
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True)),
56
 
            ],
57
 
            options={
58
 
                'ordering': ('-last_update',),
59
 
            },
60
 
        ),
61
 
        migrations.AlterUniqueTogether(
62
 
            name='visitor',
63
 
            unique_together=set([('session_key', 'ip_address')]),
64
 
        ),
65
 
    ]