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
e9c244fc
Commit
e9c244fc
authored
Jan 11, 2014
by
Russell Jones
Committed by
benjaoming
May 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move to python3-style unicode everywhere str()
parent
4f9bf51f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
12 deletions
+16
-12
docs/conf.py
+1
-1
wiki/editors/markitup.py
+4
-2
wiki/plugins/attachments/models.py
+10
-8
wiki/plugins/links/mdx/djangowikilinks.py
+1
-1
No files found.
docs/conf.py
View file @
e9c244fc
from
__future__
import
print_function
,
unicode_literals
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
__future__
import
print_function
,
unicode_literals
#
#
# django-wiki documentation build configuration file, created by
# django-wiki documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 23 16:13:51 2012.
# sphinx-quickstart on Mon Jul 23 16:13:51 2012.
...
...
wiki/editors/markitup.py
View file @
e9c244fc
# -*- coding: utf-8
from
__future__
import
unicode_literals
from
django
import
forms
from
django
import
forms
from
django.forms.util
import
flatatt
from
django.forms.util
import
flatatt
try
:
try
:
...
@@ -24,7 +26,7 @@ class MarkItUpAdminWidget(forms.Widget):
...
@@ -24,7 +26,7 @@ class MarkItUpAdminWidget(forms.Widget):
def
render
(
self
,
name
,
value
,
attrs
=
None
):
def
render
(
self
,
name
,
value
,
attrs
=
None
):
if
value
is
None
:
value
=
''
if
value
is
None
:
value
=
''
final_attrs
=
self
.
build_attrs
(
attrs
,
name
=
name
)
final_attrs
=
self
.
build_attrs
(
attrs
,
name
=
name
)
return
mark_safe
(
u
'<textarea
%
s>
%
s</textarea>'
%
(
flatatt
(
final_attrs
),
return
mark_safe
(
'<textarea
%
s>
%
s</textarea>'
%
(
flatatt
(
final_attrs
),
conditional_escape
(
force_unicode
(
value
))))
conditional_escape
(
force_unicode
(
value
))))
...
@@ -40,7 +42,7 @@ class MarkItUpWidget(forms.Widget):
...
@@ -40,7 +42,7 @@ class MarkItUpWidget(forms.Widget):
def
render
(
self
,
name
,
value
,
attrs
=
None
):
def
render
(
self
,
name
,
value
,
attrs
=
None
):
if
value
is
None
:
value
=
''
if
value
is
None
:
value
=
''
final_attrs
=
self
.
build_attrs
(
attrs
,
name
=
name
)
final_attrs
=
self
.
build_attrs
(
attrs
,
name
=
name
)
return
mark_safe
(
u
'<div><textarea
%
s>
%
s</textarea></div>'
%
(
flatatt
(
final_attrs
),
return
mark_safe
(
'<div><textarea
%
s>
%
s</textarea></div>'
%
(
flatatt
(
final_attrs
),
conditional_escape
(
force_unicode
(
value
))))
conditional_escape
(
force_unicode
(
value
))))
...
...
wiki/plugins/attachments/models.py
View file @
e9c244fc
# -*- coding: utf-8 -*-
from
__future__
import
print_function
,
unicode_literals
import
os.path
import
os.path
from
django.db
import
models
from
django.db
import
models
...
@@ -23,12 +25,12 @@ class Attachment(ReusablePlugin):
...
@@ -23,12 +25,12 @@ class Attachment(ReusablePlugin):
current_revision
=
models
.
OneToOneField
(
current_revision
=
models
.
OneToOneField
(
'AttachmentRevision'
,
'AttachmentRevision'
,
verbose_name
=
_
(
u
'current revision'
),
verbose_name
=
_
(
'current revision'
),
blank
=
True
,
null
=
True
,
related_name
=
'current_set'
,
blank
=
True
,
null
=
True
,
related_name
=
'current_set'
,
help_text
=
_
(
u
'The revision of this attachment currently in use (on all articles using the attachment)'
),
help_text
=
_
(
'The revision of this attachment currently in use (on all articles using the attachment)'
),
)
)
original_filename
=
models
.
CharField
(
max_length
=
256
,
verbose_name
=
_
(
u
'original filename'
),
blank
=
True
,
null
=
True
)
original_filename
=
models
.
CharField
(
max_length
=
256
,
verbose_name
=
_
(
'original filename'
),
blank
=
True
,
null
=
True
)
def
can_write
(
self
,
user
):
def
can_write
(
self
,
user
):
if
not
settings
.
ANONYMOUS
and
(
not
user
or
user
.
is_anonymous
()):
if
not
settings
.
ANONYMOUS
and
(
not
user
or
user
.
is_anonymous
()):
...
@@ -39,8 +41,8 @@ class Attachment(ReusablePlugin):
...
@@ -39,8 +41,8 @@ class Attachment(ReusablePlugin):
return
self
.
can_write
(
user
)
return
self
.
can_write
(
user
)
class
Meta
:
class
Meta
:
verbose_name
=
_
(
u
'attachment'
)
verbose_name
=
_
(
'attachment'
)
verbose_name_plural
=
_
(
u
'attachments'
)
verbose_name_plural
=
_
(
'attachments'
)
app_label
=
settings
.
APP_LABEL
app_label
=
settings
.
APP_LABEL
def
__unicode__
(
self
):
def
__unicode__
(
self
):
...
@@ -90,14 +92,14 @@ class AttachmentRevision(BaseRevisionMixin, models.Model):
...
@@ -90,14 +92,14 @@ class AttachmentRevision(BaseRevisionMixin, models.Model):
file
=
models
.
FileField
(
upload_to
=
upload_path
,
#@ReservedAssignment
file
=
models
.
FileField
(
upload_to
=
upload_path
,
#@ReservedAssignment
max_length
=
255
,
max_length
=
255
,
verbose_name
=
_
(
u
'file'
),
verbose_name
=
_
(
'file'
),
storage
=
settings
.
STORAGE_BACKEND
)
storage
=
settings
.
STORAGE_BACKEND
)
description
=
models
.
TextField
(
blank
=
True
)
description
=
models
.
TextField
(
blank
=
True
)
class
Meta
:
class
Meta
:
verbose_name
=
_
(
u
'attachment revision'
)
verbose_name
=
_
(
'attachment revision'
)
verbose_name_plural
=
_
(
u
'attachment revisions'
)
verbose_name_plural
=
_
(
'attachment revisions'
)
ordering
=
(
'created'
,)
ordering
=
(
'created'
,)
get_latest_by
=
'revision_number'
get_latest_by
=
'revision_number'
app_label
=
settings
.
APP_LABEL
app_label
=
settings
.
APP_LABEL
...
...
wiki/plugins/links/mdx/djangowikilinks.py
View file @
e9c244fc
...
@@ -13,7 +13,7 @@ Basic usage:
...
@@ -13,7 +13,7 @@ Basic usage:
>>> text = "Some text with a [Link Name](wiki:ArticleName)."
>>> text = "Some text with a [Link Name](wiki:ArticleName)."
>>> html = markdown.markdown(text, ['wikipath(base_url="/wiki/view/")'])
>>> html = markdown.markdown(text, ['wikipath(base_url="/wiki/view/")'])
>>> html
>>> html
u
'<p>Some text with a <a class="wikipath" href="/wiki/view/ArticleName/">Link Name</a>.</p>'
'<p>Some text with a <a class="wikipath" href="/wiki/view/ArticleName/">Link Name</a>.</p>'
Dependencies:
Dependencies:
* [Python 2.3+](http://python.org)
* [Python 2.3+](http://python.org)
...
...
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