forked from django-wiki/django-wiki
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from edx/jmbowman/migrations_cleanup
Don't import plugin models in main migrations
- Loading branch information
Showing
13 changed files
with
240 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ def build_media_pattern(base_folder, file_extension): | |
|
||
setup( | ||
name = "django-wiki", | ||
version="0.0.11", | ||
version="0.0.12", | ||
author = "Benjamin Bach", | ||
author_email = "[email protected]", | ||
description = ("A wiki system written for the Django framework."), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
from django.apps import AppConfig | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
|
||
class NotifcationsConfig(AppConfig): | ||
name = 'wiki.plugins.notifications' | ||
verbose_name = _("Wiki notifications") | ||
label = 'wiki_notifications' | ||
|
||
|
||
class ImagesConfig(AppConfig): | ||
name = 'wiki.plugins.images' | ||
verbose_name = _("Wiki images") | ||
label = 'wiki_images' | ||
|
||
|
||
class AttachmentsConfig(AppConfig): | ||
name = 'wiki.plugins.attachments' | ||
verbose_name = _("Wiki attachments") | ||
label = 'wiki_attachments' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.5 on 2017-09-07 19:03 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wiki', '0004_increase_slug_size'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='attachment', | ||
name='current_revision', | ||
), | ||
migrations.RemoveField( | ||
model_name='attachment', | ||
name='reusableplugin_ptr', | ||
), | ||
migrations.RemoveField( | ||
model_name='attachmentrevision', | ||
name='attachment', | ||
), | ||
migrations.RemoveField( | ||
model_name='attachmentrevision', | ||
name='previous_revision', | ||
), | ||
migrations.RemoveField( | ||
model_name='attachmentrevision', | ||
name='user', | ||
), | ||
migrations.RemoveField( | ||
model_name='image', | ||
name='revisionplugin_ptr', | ||
), | ||
migrations.RemoveField( | ||
model_name='imagerevision', | ||
name='revisionpluginrevision_ptr', | ||
), | ||
migrations.DeleteModel( | ||
name='Attachment', | ||
), | ||
migrations.DeleteModel( | ||
name='AttachmentRevision', | ||
), | ||
migrations.DeleteModel( | ||
name='Image', | ||
), | ||
migrations.DeleteModel( | ||
name='ImageRevision', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from __future__ import unicode_literals | ||
default_app_config = 'wiki.apps.AttachmentsConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
import wiki.plugins.attachments.models | ||
from django.conf import settings | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wiki', '0004_increase_slug_size'), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='AttachmentRevision', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('revision_number', models.IntegerField(verbose_name='revision number', editable=False)), | ||
('user_message', models.TextField(blank=True)), | ||
('automatic_log', models.TextField(editable=False, blank=True)), | ||
('ip_address', models.GenericIPAddressField(verbose_name='IP address', null=True, editable=False, blank=True)), | ||
('modified', models.DateTimeField(auto_now=True)), | ||
('created', models.DateTimeField(auto_now_add=True)), | ||
('deleted', models.BooleanField(default=False, verbose_name='deleted')), | ||
('locked', models.BooleanField(default=False, verbose_name='locked')), | ||
('file', models.FileField(upload_to=wiki.plugins.attachments.models.upload_path, verbose_name='file')), | ||
('description', models.TextField(blank=True)), | ||
], | ||
options={ | ||
'ordering': ('created',), | ||
'get_latest_by': 'revision_number', | ||
'verbose_name': 'attachment revision', | ||
'verbose_name_plural': 'attachment revisions', | ||
'db_table': 'wiki_attachments_attachmentrevision', | ||
}, | ||
bases=(models.Model,), | ||
), | ||
migrations.CreateModel( | ||
name='Attachment', | ||
fields=[ | ||
('reusableplugin_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wiki.ReusablePlugin')), | ||
('original_filename', models.CharField(max_length=256, null=True, verbose_name='original filename', blank=True)), | ||
], | ||
options={ | ||
'verbose_name': 'attachment', | ||
'verbose_name_plural': 'attachments', | ||
'db_table': 'wiki_attachments_attachment', | ||
}, | ||
bases=('wiki.reusableplugin',), | ||
), | ||
migrations.AddField( | ||
model_name='attachmentrevision', | ||
name='attachment', | ||
field=models.ForeignKey(to='wiki_attachments.Attachment'), | ||
preserve_default=True, | ||
), | ||
migrations.AddField( | ||
model_name='attachmentrevision', | ||
name='previous_revision', | ||
field=models.ForeignKey(blank=True, to='wiki_attachments.AttachmentRevision', null=True), | ||
preserve_default=True, | ||
), | ||
migrations.AddField( | ||
model_name='attachmentrevision', | ||
name='user', | ||
field=models.ForeignKey(verbose_name='user', blank=True, to=settings.AUTH_USER_MODEL, null=True), | ||
preserve_default=True, | ||
), | ||
migrations.AddField( | ||
model_name='attachment', | ||
name='current_revision', | ||
field=models.OneToOneField(related_name='current_set', null=True, to='wiki_attachments.AttachmentRevision', blank=True, help_text='The revision of this attachment currently in use (on all articles using the attachment)', verbose_name='current revision'), | ||
preserve_default=True, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from __future__ import unicode_literals | ||
default_app_config = 'wiki.apps.ImagesConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
import wiki.plugins.images.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wiki', '0004_increase_slug_size'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Image', | ||
fields=[ | ||
('revisionplugin_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wiki.RevisionPlugin')), | ||
], | ||
options={ | ||
'verbose_name': 'image', | ||
'verbose_name_plural': 'images', | ||
'db_table': 'wiki_images_image', | ||
}, | ||
bases=('wiki.revisionplugin',), | ||
), | ||
migrations.CreateModel( | ||
name='ImageRevision', | ||
fields=[ | ||
('revisionpluginrevision_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wiki.RevisionPluginRevision')), | ||
('image', models.ImageField(upload_to=wiki.plugins.images.models.upload_path, width_field=b'width', height_field=b'height', max_length=2000, blank=True, null=True)), | ||
('width', models.SmallIntegerField(null=True, blank=True)), | ||
('height', models.SmallIntegerField(null=True, blank=True)), | ||
], | ||
options={ | ||
'ordering': ('-created',), | ||
'verbose_name': 'image revision', | ||
'verbose_name_plural': 'image revisions', | ||
'db_table': 'wiki_images_imagerevision', | ||
}, | ||
bases=('wiki.revisionpluginrevision',), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
from __future__ import unicode_literals | ||
default_app_config = 'wiki.apps.NotifcationsConfig' | ||
|
||
# Key for django_notify | ||
ARTICLE_EDIT = "article_edit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wiki', '0004_increase_slug_size'), | ||
('django_notify', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ArticleSubscription', | ||
fields=[ | ||
('subscription_ptr', models.OneToOneField(parent_link=True, auto_created=True, to='django_notify.Subscription')), | ||
('articleplugin_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='wiki.ArticlePlugin')), | ||
], | ||
options={ | ||
'db_table': 'wiki_notifications_articlesubscription', | ||
}, | ||
bases=('wiki.articleplugin', 'django_notify.subscription'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters