mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 06:17:17 +00:00
added feed of recent comics.
This commit is contained in:
28
comic/migrations/0017_usermisc.py
Normal file
28
comic/migrations/0017_usermisc.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.3 on 2017-01-13 15:28
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import uuid
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('comic', '0016_auto_20160414_1335'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='UserMisc',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('feed_id', models.UUIDField(db_index=True, default=uuid.uuid4, unique=True)),
|
||||
(
|
||||
'user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
||||
22
comic/migrations/0018_auto_20170113_1531.py
Normal file
22
comic/migrations/0018_auto_20170113_1531.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.3 on 2017-01-13 15:31
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def gen_feeds(apps, schema_editor):
|
||||
user_misc = apps.get_model('comic', 'UserMisc')
|
||||
User = apps.get_model('auth', 'user')
|
||||
for user in User.objects.all():
|
||||
um = user_misc.objects.create(user=user)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('comic', '0017_usermisc'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(gen_feeds, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
Reference in New Issue
Block a user