# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-01 18:19
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import scrooge.datasource.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='DataSourceModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, unique=True, verbose_name='Name')),
            ],
        ),
        migrations.CreateModel(
            name='XmlDataField',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('xpath', models.CharField(blank=True, default='', help_text='Relative xpath needed to extract value of field', max_length=256, validators=[scrooge.datasource.models.xpath_validator])),
            ],
        ),
        migrations.CreateModel(
            name='XmlDataSourceModel',
            fields=[
                ('datasourcemodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='datasource.DataSourceModel')),
                ('type', models.IntegerField(choices=[(1, 'Single XML')], default=1, verbose_name='Data source type')),
                ('url', models.URLField(default=None, help_text='URL address of data source')),
                ('offers_xpath', models.CharField(default='', help_text='<br />XPath&nbsp;to&nbsp;offer&nbsp;elements.<br /><br />For&nbsp;document&nbsp;below,&nbsp;that&nbsp;would&nbsp;be&nbsp;/root/book<br />&lt;root&gt;<br />&nbsp;&nbsp;&lt;book&gt;&lt;/book&gt;<br />&nbsp;&nbsp;&lt;book&gt;&lt;/book&gt;<br />&lt;/root&gt;<br /><br />For&nbsp;document&nbsp;below,&nbsp;that&nbsp;would&nbsp;be&nbsp;/root/offers/offer<br />&lt;root&gt;<br />&nbsp;&nbsp;&lt;store&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;location&gt;&lt;/location&gt;<br />&nbsp;&nbsp;&lt;/store&gt;<br />&nbsp;&nbsp;&lt;offers&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;offer&gt;&lt;/offer&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;offer&gt;&lt;/offer&gt;<br />&nbsp;&nbsp;&lt;/offers&gt;<br />&lt;/root&gt;<br />', max_length=64)),
                ('custom_class', models.CharField(choices=[('Publio', 'Publio'), ('Woblink', 'Woblink'), ('XmlDataSourceImpl', 'XmlDataSourceImpl')], default='XmlDataSourceImpl', max_length=32)),
            ],
            bases=('datasource.datasourcemodel',),
        ),
        migrations.AddField(
            model_name='xmldatafield',
            name='data_source',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datasource.XmlDataSourceModel'),
        ),
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-01 18:19
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import scrooge.datasource.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='DataSourceModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, unique=True, verbose_name='Name')),
            ],
        ),
        migrations.CreateModel(
            name='XmlDataField',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('xpath', models.CharField(blank=True, default='', help_text='Relative xpath needed to extract value of field', max_length=256, validators=[scrooge.datasource.models.xpath_validator])),
            ],
        ),
        migrations.CreateModel(
            name='XmlDataSourceModel',
            fields=[
                ('datasourcemodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='datasource.DataSourceModel')),
                ('type', models.IntegerField(choices=[(1, 'Single XML')], default=1, verbose_name='Data source type')),
                ('url', models.URLField(default=None, help_text='URL address of data source')),
                ('offers_xpath', models.CharField(default='', help_text='<br />XPath&nbsp;to&nbsp;offer&nbsp;elements.<br /><br />For&nbsp;document&nbsp;below,&nbsp;that&nbsp;would&nbsp;be&nbsp;/root/book<br />&lt;root&gt;<br />&nbsp;&nbsp;&lt;book&gt;&lt;/book&gt;<br />&nbsp;&nbsp;&lt;book&gt;&lt;/book&gt;<br />&lt;/root&gt;<br /><br />For&nbsp;document&nbsp;below,&nbsp;that&nbsp;would&nbsp;be&nbsp;/root/offers/offer<br />&lt;root&gt;<br />&nbsp;&nbsp;&lt;store&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;location&gt;&lt;/location&gt;<br />&nbsp;&nbsp;&lt;/store&gt;<br />&nbsp;&nbsp;&lt;offers&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;offer&gt;&lt;/offer&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;offer&gt;&lt;/offer&gt;<br />&nbsp;&nbsp;&lt;/offers&gt;<br />&lt;/root&gt;<br />', max_length=64)),
                ('custom_class', models.CharField(choices=[('Publio', 'Publio'), ('Woblink', 'Woblink'), ('XmlDataSourceImpl', 'XmlDataSourceImpl')], default='XmlDataSourceImpl', max_length=32)),
            ],
            bases=('datasource.datasourcemodel',),
        ),
        migrations.AddField(
            model_name='xmldatafield',
            name='data_source',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datasource.XmlDataSourceModel'),
        ),
    ]

# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-06-01 18:19