Files @ d5446363fedf
Branch filter:

Location: conntrackt/conntrackt/migrations/0001_initial.py

branko
CONNT-25: Updating application and project to use Django 1.7.x:

- Updated test project to use the same base template as the fresh
Django project started with Django 1.7.x admin tool.
- Fixed deprecation warnings related to model forms not including
explicit list of fields to be included or excluded.
- Removed all South migrations, replacing them with native Django
migration.
- Updated release notes.
- Bumped Django version in setup script.
- Bumped Django version in requirements files.
- Removed South from both installation and development requirements.
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Branko Majic
#
# This file is part of Django Conntrackt.
#
# Django Conntrackt is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# Django Conntrackt is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# Django Conntrackt.  If not, see <http://www.gnu.org/licenses/>.
#

from __future__ import unicode_literals

from django.db import models, migrations
import conntrackt.models


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Communication',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('protocol', models.CharField(max_length=10, choices=[(b'TCP', b'TCP'), (b'UDP', b'UDP'), (b'ICMP', b'ICMP')])),
                ('port', models.IntegerField(default=0)),
                ('description', models.TextField(blank=True)),
            ],
            options={
            },
            bases=(conntrackt.models.RelatedCollectorMixin, models.Model),
        ),
        migrations.CreateModel(
            name='Entity',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=100)),
                ('description', models.TextField(blank=True)),
            ],
            options={
                'verbose_name_plural': 'entities',
            },
            bases=(conntrackt.models.RelatedCollectorMixin, models.Model),
        ),
        migrations.CreateModel(
            name='Interface',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(default=b'eth0', max_length=100)),
                ('description', models.TextField(default=b'Main network interface.', blank=True)),
                ('address', models.IPAddressField()),
                ('netmask', models.IPAddressField(default=b'255.255.255.255')),
                ('entity', models.ForeignKey(to='conntrackt.Entity')),
            ],
            options={
            },
            bases=(conntrackt.models.RelatedCollectorMixin, models.Model),
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(unique=True, max_length=100)),
                ('description', models.TextField(blank=True)),
            ],
            options={
            },
            bases=(conntrackt.models.RelatedCollectorMixin, models.Model),
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(unique=True, max_length=100)),
                ('description', models.TextField(blank=True)),
            ],
            options={
                'permissions': (('view', 'Can view information'),),
            },
            bases=(conntrackt.models.RelatedCollectorMixin, models.Model),
        ),
        migrations.AlterUniqueTogether(
            name='interface',
            unique_together=set([('name', 'entity'), ('entity', 'address', 'netmask')]),
        ),
        migrations.AddField(
            model_name='entity',
            name='location',
            field=models.ForeignKey(to='conntrackt.Location'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='entity',
            name='project',
            field=models.ForeignKey(to='conntrackt.Project'),
            preserve_default=True,
        ),
        migrations.AlterUniqueTogether(
            name='entity',
            unique_together=set([('name', 'project')]),
        ),
        migrations.AddField(
            model_name='communication',
            name='destination',
            field=models.ForeignKey(related_name='destination_set', to='conntrackt.Interface'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='communication',
            name='source',
            field=models.ForeignKey(related_name='source_set', to='conntrackt.Interface'),
            preserve_default=True,
        ),
        migrations.AlterUniqueTogether(
            name='communication',
            unique_together=set([('source', 'destination', 'protocol', 'port')]),
        ),
    ]