# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-24 14:35
from __future__ import unicode_literals

import re

import django.core.validators
import openwisp_utils.base
import openwisp_utils.utils
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('django_netjsongraph', '0002_topology_published'),
    ]

    operations = [
        migrations.AddField(
            model_name='topology',
            name='strategy',
            field=models.CharField(
                choices=[('fetch', 'FETCH'), ('receive', 'RECEIVE')],
                db_index=True,
                default='fetch',
                max_length=16,
                verbose_name='strategy',
            ),
        ),
        migrations.AddField(
            model_name='topology',
            name='expiration_time',
            field=models.PositiveIntegerField(
                default=0,
                help_text='"Expiration Time" in seconds: setting this to 0 will immediately mark missing links as down; a value higher than 0 will delay marking missing links as down until the "modified" field of a link is older than "Expiration Time"',
                verbose_name='expiration time',
            ),
        ),
        migrations.AddField(
            model_name='topology',
            name='key',
            field=openwisp_utils.base.KeyField(
                blank=True,
                default=openwisp_utils.utils.get_random_key,
                help_text='key needed to update topology from nodes ',
                max_length=64,
                validators=[
                    django.core.validators.RegexValidator(
                        re.compile('^[^\\s/\\.]+$'),
                        code='invalid',
                        message='This value must not contain spaces, dots or slashes.',
                    )
                ],
                verbose_name='key',
            ),
        ),
    ]
