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
457c487b
Commit
457c487b
authored
Feb 11, 2014
by
Luke Plant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged wiki.compat into wiki.core.compat
parent
086a36ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
17 deletions
+18
-17
wiki/compat.py
+0
-16
wiki/core/compat.py
+17
-0
wiki/models/urlpath.py
+1
-1
No files found.
wiki/compat.py
deleted
100644 → 0
View file @
086a36ce
from
django.db
import
transaction
# Django 1.6 transaction API, required for 1.8+
def
nop_decorator
(
func
):
return
func
# Where these are used in code, both old and new methods for transactions appear
# to be used, but only one will actually do anything. When only Django 1.8+
# is supported, transaction_commit_on_success can be deleted.
try
:
atomic
=
transaction
.
atomic
# Does it exist?
transaction_commit_on_success
=
nop_decorator
except
AttributeError
:
atomic
=
nop_decorator
transaction_commit_on_success
=
transaction
.
commit_on_success
wiki/core/compat.py
View file @
457c487b
"""Abstraction layer to deal with Django related changes in order to keep
"""Abstraction layer to deal with Django related changes in order to keep
compatibility with several Django versions simultaneously."""
compatibility with several Django versions simultaneously."""
from
django
import
VERSION
as
DJANGO_VERSION
from
django
import
VERSION
as
DJANGO_VERSION
from
django.db
import
transaction
from
django.conf
import
settings
as
django_settings
from
django.conf
import
settings
as
django_settings
# Django 1.5+
# Django 1.5+
if
DJANGO_VERSION
>=
(
1
,
5
):
if
DJANGO_VERSION
>=
(
1
,
5
):
...
@@ -17,3 +19,18 @@ def get_user_model():
...
@@ -17,3 +19,18 @@ def get_user_model():
else
:
else
:
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
return
User
return
User
# Django 1.6 transaction API, required for 1.8+
def
nop_decorator
(
func
):
return
func
# Where these are used in code, both old and new methods for transactions appear
# to be used, but only one will actually do anything. When only Django 1.8+
# is supported, transaction_commit_on_success can be deleted.
try
:
atomic
=
transaction
.
atomic
# Does it exist?
transaction_commit_on_success
=
nop_decorator
except
AttributeError
:
atomic
=
nop_decorator
transaction_commit_on_success
=
transaction
.
commit_on_success
wiki/models/urlpath.py
View file @
457c487b
...
@@ -15,8 +15,8 @@ from mptt.fields import TreeForeignKey
...
@@ -15,8 +15,8 @@ from mptt.fields import TreeForeignKey
from
mptt.models
import
MPTTModel
from
mptt.models
import
MPTTModel
from
wiki
import
managers
from
wiki
import
managers
from
wiki.compat
import
atomic
,
transaction_commit_on_success
from
wiki.conf
import
settings
from
wiki.conf
import
settings
from
wiki.core.compat
import
atomic
,
transaction_commit_on_success
from
wiki.core.exceptions
import
NoRootURL
,
MultipleRootURLs
from
wiki.core.exceptions
import
NoRootURL
,
MultipleRootURLs
from
wiki.models.article
import
ArticleRevision
,
ArticleForObject
,
Article
from
wiki.models.article
import
ArticleRevision
,
ArticleForObject
,
Article
...
...
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