Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
65514af9
Commit
65514af9
authored
Sep 07, 2017
by
Jeremy Bowman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't import plugin models in main migrations
parent
f3dce909
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
240 additions
and
5 deletions
+240
-5
setup.py
+1
-1
wiki/apps.py
+22
-0
wiki/migrations/0001_initial.py
+2
-4
wiki/migrations/0005_remove_attachments_and_images.py
+55
-0
wiki/plugins/attachments/__init__.py
+2
-0
wiki/plugins/attachments/migrations/0001_initial.py
+78
-0
wiki/plugins/attachments/models.py
+2
-0
wiki/plugins/images/__init__.py
+2
-0
wiki/plugins/images/migrations/0001_initial.py
+43
-0
wiki/plugins/images/models.py
+2
-0
wiki/plugins/notifications/__init__.py
+3
-0
wiki/plugins/notifications/migrations/0001_initial.py
+26
-0
wiki/plugins/notifications/models.py
+2
-0
No files found.
setup.py
View file @
65514af9
...
@@ -29,7 +29,7 @@ package_data = dict(
...
@@ -29,7 +29,7 @@ package_data = dict(
setup
(
setup
(
name
=
"django-wiki"
,
name
=
"django-wiki"
,
version
=
"0.0.1
1
"
,
version
=
"0.0.1
2
"
,
author
=
"Benjamin Bach"
,
author
=
"Benjamin Bach"
,
author_email
=
"benjamin@overtag.dk"
,
author_email
=
"benjamin@overtag.dk"
,
description
=
(
"A wiki system written for the Django framework."
),
description
=
(
"A wiki system written for the Django framework."
),
...
...
wiki/apps.py
0 → 100644
View file @
65514af9
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'
wiki/migrations/0001_initial.py
View file @
65514af9
...
@@ -3,8 +3,6 @@ from __future__ import unicode_literals
...
@@ -3,8 +3,6 @@ from __future__ import unicode_literals
from
django.db
import
models
,
migrations
from
django.db
import
models
,
migrations
import
mptt.fields
import
mptt.fields
import
wiki.plugins.images.models
import
wiki.plugins.attachments.models
from
django.conf
import
settings
from
django.conf
import
settings
...
@@ -107,7 +105,7 @@ class Migration(migrations.Migration):
...
@@ -107,7 +105,7 @@ class Migration(migrations.Migration):
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'deleted'
,
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'deleted'
)),
(
'deleted'
,
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'deleted'
)),
(
'locked'
,
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'locked'
)),
(
'locked'
,
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'locked'
)),
(
'file'
,
models
.
FileField
(
upload_to
=
wiki
.
plugins
.
attachments
.
models
.
upload_path
,
verbose_name
=
'file'
)),
(
'file'
,
models
.
FileField
(
upload_to
=
'wiki/uploads/'
,
verbose_name
=
'file'
)),
(
'description'
,
models
.
TextField
(
blank
=
True
)),
(
'description'
,
models
.
TextField
(
blank
=
True
)),
],
],
options
=
{
options
=
{
...
@@ -182,7 +180,7 @@ class Migration(migrations.Migration):
...
@@ -182,7 +180,7 @@ class Migration(migrations.Migration):
name
=
'ImageRevision'
,
name
=
'ImageRevision'
,
fields
=
[
fields
=
[
(
'revisionpluginrevision_ptr'
,
models
.
OneToOneField
(
parent_link
=
True
,
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
to
=
'wiki.RevisionPluginRevision'
)),
(
'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
)),
(
'image'
,
models
.
ImageField
(
upload_to
=
'wiki/uploads/'
,
width_field
=
b
'width'
,
height_field
=
b
'height'
,
max_length
=
2000
,
blank
=
True
,
null
=
True
)),
(
'width'
,
models
.
SmallIntegerField
(
null
=
True
,
blank
=
True
)),
(
'width'
,
models
.
SmallIntegerField
(
null
=
True
,
blank
=
True
)),
(
'height'
,
models
.
SmallIntegerField
(
null
=
True
,
blank
=
True
)),
(
'height'
,
models
.
SmallIntegerField
(
null
=
True
,
blank
=
True
)),
],
],
...
...
wiki/migrations/0005_remove_attachments_and_images.py
0 → 100644
View file @
65514af9
# -*- 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'
,
),
]
wiki/plugins/attachments/__init__.py
View file @
65514af9
from
__future__
import
unicode_literals
default_app_config
=
'wiki.apps.AttachmentsConfig'
wiki/plugins/attachments/migrations/0001_initial.py
0 → 100644
View file @
65514af9
# -*- 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
,
),
]
wiki/plugins/attachments/models.py
View file @
65514af9
...
@@ -35,6 +35,7 @@ class Attachment(ReusablePlugin):
...
@@ -35,6 +35,7 @@ class Attachment(ReusablePlugin):
class
Meta
:
class
Meta
:
verbose_name
=
_
(
u'attachment'
)
verbose_name
=
_
(
u'attachment'
)
verbose_name_plural
=
_
(
u'attachments'
)
verbose_name_plural
=
_
(
u'attachments'
)
db_table
=
'wiki_attachments_attachment'
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
"
%
s:
%
s"
%
(
self
.
article
.
current_revision
.
title
,
self
.
original_filename
)
return
"
%
s:
%
s"
%
(
self
.
article
.
current_revision
.
title
,
self
.
original_filename
)
...
@@ -85,6 +86,7 @@ class AttachmentRevision(BaseRevisionMixin, models.Model):
...
@@ -85,6 +86,7 @@ class AttachmentRevision(BaseRevisionMixin, models.Model):
verbose_name_plural
=
_
(
u'attachment revisions'
)
verbose_name_plural
=
_
(
u'attachment revisions'
)
ordering
=
(
'created'
,)
ordering
=
(
'created'
,)
get_latest_by
=
'revision_number'
get_latest_by
=
'revision_number'
db_table
=
'wiki_attachments_attachmentrevision'
def
get_filename
(
self
):
def
get_filename
(
self
):
"""Used to retrieve the filename of a revision.
"""Used to retrieve the filename of a revision.
...
...
wiki/plugins/images/__init__.py
View file @
65514af9
from
__future__
import
unicode_literals
default_app_config
=
'wiki.apps.ImagesConfig'
wiki/plugins/images/migrations/0001_initial.py
0 → 100644
View file @
65514af9
# -*- 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'
,),
),
]
wiki/plugins/images/models.py
View file @
65514af9
...
@@ -39,6 +39,7 @@ class Image(RevisionPlugin):
...
@@ -39,6 +39,7 @@ class Image(RevisionPlugin):
class
Meta
:
class
Meta
:
verbose_name
=
_
(
u'image'
)
verbose_name
=
_
(
u'image'
)
verbose_name_plural
=
_
(
u'images'
)
verbose_name_plural
=
_
(
u'images'
)
db_table
=
'wiki_images_image'
def
__unicode__
(
self
):
def
__unicode__
(
self
):
title
=
(
_
(
u'Image:
%
s'
)
%
self
.
current_revision
.
imagerevision
.
get_filename
())
if
self
.
current_revision
else
_
(
u'Current revision not set!!'
)
title
=
(
_
(
u'Image:
%
s'
)
%
self
.
current_revision
.
imagerevision
.
get_filename
())
if
self
.
current_revision
else
_
(
u'Current revision not set!!'
)
...
@@ -90,6 +91,7 @@ class ImageRevision(RevisionPluginRevision):
...
@@ -90,6 +91,7 @@ class ImageRevision(RevisionPluginRevision):
class
Meta
:
class
Meta
:
verbose_name
=
_
(
u'image revision'
)
verbose_name
=
_
(
u'image revision'
)
verbose_name_plural
=
_
(
u'image revisions'
)
verbose_name_plural
=
_
(
u'image revisions'
)
db_table
=
'wiki_images_imagerevision'
ordering
=
(
'-created'
,)
ordering
=
(
'-created'
,)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
...
...
wiki/plugins/notifications/__init__.py
View file @
65514af9
from
__future__
import
unicode_literals
default_app_config
=
'wiki.apps.NotifcationsConfig'
# Key for django_notify
# Key for django_notify
ARTICLE_EDIT
=
"article_edit"
ARTICLE_EDIT
=
"article_edit"
wiki/plugins/notifications/migrations/0001_initial.py
0 → 100644
View file @
65514af9
# -*- 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'
),
),
]
wiki/plugins/notifications/models.py
View file @
65514af9
...
@@ -19,6 +19,8 @@ class ArticleSubscription(ArticlePlugin, Subscription):
...
@@ -19,6 +19,8 @@ class ArticleSubscription(ArticlePlugin, Subscription):
'article'
:
self
.
article
.
current_revision
.
title
,
'article'
:
self
.
article
.
current_revision
.
title
,
'type'
:
self
.
notification_type
.
label
})
'type'
:
self
.
notification_type
.
label
})
class
Meta
:
db_table
=
'wiki_notifications_articlesubscription'
def
default_url
(
article
,
urlpath
=
None
):
def
default_url
(
article
,
urlpath
=
None
):
try
:
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment