storage backend reworked

This commit is contained in:
vabene1111
2018-05-25 16:49:10 +02:00
parent c5986c6e7f
commit 4871b6194c
21 changed files with 278 additions and 128 deletions

View File

@ -1,4 +1,4 @@
# Generated by Django 2.0.5 on 2018-05-14 08:50
# Generated by Django 2.0.5 on 2018-05-25 13:11
from django.db import migrations, models
import django.db.models.deletion
@ -17,6 +17,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64, unique=True)),
('icon', models.CharField(blank=True, max_length=1, null=True)),
('description', models.TextField(blank=True, default='')),
('created_by', models.IntegerField(default=0)),
('created_at', models.DateTimeField(auto_now_add=True)),
@ -28,6 +29,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64, unique=True)),
('icon', models.CharField(blank=True, max_length=1, null=True)),
('description', models.TextField(blank=True, default='')),
('created_by', models.IntegerField(default=0)),
('created_at', models.DateTimeField(auto_now_add=True)),
@ -44,7 +46,7 @@ class Migration(migrations.Migration):
('created_by', models.IntegerField(default=0)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cookbook.Category')),
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='cookbook.Category')),
('keywords', models.ManyToManyField(blank=True, to='cookbook.Keyword')),
],
),
@ -57,6 +59,18 @@ class Migration(migrations.Migration):
('created_at', models.DateTimeField(auto_now_add=True)),
],
),
migrations.CreateModel(
name='Storage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=128)),
('method', models.CharField(choices=[('DB', 'Dropbox')], default='DB', max_length=128)),
('username', models.CharField(blank=True, max_length=128, null=True)),
('password', models.CharField(blank=True, max_length=128, null=True)),
('token', models.CharField(blank=True, max_length=512, null=True)),
('url', models.URLField(blank=True, null=True)),
],
),
migrations.CreateModel(
name='Sync',
fields=[
@ -65,6 +79,7 @@ class Migration(migrations.Migration):
('last_checked', models.DateTimeField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('storage', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='cookbook.Storage')),
],
),
migrations.CreateModel(
@ -77,4 +92,9 @@ class Migration(migrations.Migration):
('monitor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cookbook.Sync')),
],
),
migrations.AddField(
model_name='recipe',
name='storage',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='cookbook.Storage'),
),
]