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
edx
django-wiki
Commits
fd9bb87d
Commit
fd9bb87d
authored
Nov 19, 2014
by
benjaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Add use __str__ with python_2_unicode_compatible for plugins too"
parent
588e6933
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
10 deletions
+3
-10
testproject/prepopulated.db
+0
-0
wiki/plugins/images/models.py
+2
-7
wiki/plugins/notifications/models.py
+1
-3
No files found.
testproject/prepopulated.db
View file @
fd9bb87d
No preview for this file type
wiki/plugins/images/models.py
View file @
fd9bb87d
...
@@ -5,7 +5,6 @@ import os.path
...
@@ -5,7 +5,6 @@ import os.path
from
django.conf
import
settings
as
django_settings
from
django.conf
import
settings
as
django_settings
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.exceptions
import
ImproperlyConfigured
from
django.db
import
models
from
django.db
import
models
from
django.utils.encoding
import
python_2_unicode_compatible
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
.
import
settings
from
.
import
settings
...
@@ -27,8 +26,6 @@ def upload_path(instance, filename):
...
@@ -27,8 +26,6 @@ def upload_path(instance, filename):
upload_path
=
os
.
path
.
join
(
upload_path
,
uuid
.
uuid4
()
.
hex
)
upload_path
=
os
.
path
.
join
(
upload_path
,
uuid
.
uuid4
()
.
hex
)
return
os
.
path
.
join
(
upload_path
,
filename
)
return
os
.
path
.
join
(
upload_path
,
filename
)
@python_2_unicode_compatible
class
Image
(
RevisionPlugin
):
class
Image
(
RevisionPlugin
):
# The plugin system is so awesome that the inheritor doesn't need to do
# The plugin system is so awesome that the inheritor doesn't need to do
...
@@ -48,12 +45,10 @@ class Image(RevisionPlugin):
...
@@ -48,12 +45,10 @@ class Image(RevisionPlugin):
if
settings
.
APP_LABEL
:
if
settings
.
APP_LABEL
:
app_label
=
settings
.
APP_LABEL
app_label
=
settings
.
APP_LABEL
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
title
=
(
_
(
'Image:
%
s'
)
%
self
.
current_revision
.
imagerevision
.
get_filename
())
if
self
.
current_revision
else
_
(
'Current revision not set!!'
)
title
=
(
_
(
'Image:
%
s'
)
%
self
.
current_revision
.
imagerevision
.
get_filename
())
if
self
.
current_revision
else
_
(
'Current revision not set!!'
)
return
str
(
title
)
return
str
(
title
)
@python_2_unicode_compatible
class
ImageRevision
(
RevisionPluginRevision
):
class
ImageRevision
(
RevisionPluginRevision
):
image
=
models
.
ImageField
(
upload_to
=
upload_path
,
image
=
models
.
ImageField
(
upload_to
=
upload_path
,
...
@@ -105,7 +100,7 @@ class ImageRevision(RevisionPluginRevision):
...
@@ -105,7 +100,7 @@ class ImageRevision(RevisionPluginRevision):
app_label
=
settings
.
APP_LABEL
app_label
=
settings
.
APP_LABEL
ordering
=
(
'-created'
,)
ordering
=
(
'-created'
,)
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
title
=
_
(
'Image Revsion:
%
d'
)
%
self
.
revision_number
title
=
_
(
'Image Revsion:
%
d'
)
%
self
.
revision_number
return
str
(
title
)
return
str
(
title
)
...
...
wiki/plugins/notifications/models.py
View file @
fd9bb87d
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.utils.encoding
import
python_2_unicode_compatible
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.db.models
import
signals
from
django.db.models
import
signals
from
django.db
import
models
from
django.db
import
models
...
@@ -17,12 +16,11 @@ from wiki.plugins.notifications import settings
...
@@ -17,12 +16,11 @@ from wiki.plugins.notifications import settings
from
wiki.plugins.notifications.util
import
get_title
from
wiki.plugins.notifications.util
import
get_title
@python_2_unicode_compatible
class
ArticleSubscription
(
ArticlePlugin
):
class
ArticleSubscription
(
ArticlePlugin
):
subscription
=
models
.
OneToOneField
(
Subscription
)
subscription
=
models
.
OneToOneField
(
Subscription
)
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
title
=
(
_
(
"
%(user)
s subscribing to
%(article)
s (
%(type)
s)"
)
%
title
=
(
_
(
"
%(user)
s subscribing to
%(article)
s (
%(type)
s)"
)
%
{
'user'
:
self
.
settings
.
user
.
username
,
{
'user'
:
self
.
settings
.
user
.
username
,
'article'
:
self
.
article
.
current_revision
.
title
,
'article'
:
self
.
article
.
current_revision
.
title
,
...
...
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