[PATCH] Convert relative imports to absolute ones
martin f. krafft
madduck at madduck.net
Tue Feb 2 08:34:49 EST 2010
A Django app should be referenced as 'mysite.' and that means that
imports need to use the site name.
In the case of patchwork, this means that imports should use
apps.patchwork instead of just patchwork.
This is the updated patch including the changes to apps/patchwork/bin/*.
Signed-off-by: martin f. krafft <madduck at madduck.net>
---
apps/patchwork/admin.py | 2 +-
apps/patchwork/bin/parsemail-batch.sh | 2 +-
apps/patchwork/bin/parsemail.py | 4 +-
apps/patchwork/bin/parsemail.sh | 2 +-
apps/patchwork/bin/rehash.py | 2 +-
apps/patchwork/bin/setup.py | 2 +-
apps/patchwork/context_processors.py | 4 +-
apps/patchwork/filters.py | 2 +-
apps/patchwork/forms.py | 2 +-
apps/patchwork/models.py | 6 ++--
apps/patchwork/requestcontext.py | 4 +-
apps/patchwork/templatetags/listurl.py | 2 +-
apps/patchwork/templatetags/pwurl.py | 2 +-
apps/patchwork/tests/__init__.py | 2 +-
apps/patchwork/tests/bundles.py | 4 +-
apps/patchwork/tests/encodings.py | 4 +-
apps/patchwork/tests/mboxviews.py | 4 +-
apps/patchwork/tests/patchparser.py | 6 ++--
apps/patchwork/tests/utils.py | 2 +-
apps/patchwork/urls.py | 42 ++++++++++++++++----------------
apps/patchwork/utils.py | 4 +-
apps/patchwork/views/__init__.py | 6 ++--
apps/patchwork/views/base.py | 10 ++++----
apps/patchwork/views/bundle.py | 24 +++++++++---------
apps/patchwork/views/patch.py | 18 +++++++-------
apps/patchwork/views/project.py | 4 +-
apps/patchwork/views/user.py | 18 +++++++-------
apps/patchwork/views/xmlrpc.py | 4 +-
apps/settings.py | 2 +-
apps/urls.py | 8 +++---
30 files changed, 99 insertions(+), 99 deletions(-)
diff --git a/apps/patchwork/admin.py b/apps/patchwork/admin.py
index 2cf1bdc..e7ce0ac 100644
--- a/apps/patchwork/admin.py
+++ b/apps/patchwork/admin.py
@@ -2,7 +2,7 @@ from django.contrib import admin
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
-from patchwork.models import Project, Person, UserProfile, State, Patch, \
+from apps.patchwork.models import Project, Person, UserProfile, State, Patch, \
Comment, Bundle
admin_site = admin.AdminSite()
diff --git a/apps/patchwork/bin/parsemail-batch.sh b/apps/patchwork/bin/parsemail-batch.sh
index d786022..60fb7c5 100755
--- a/apps/patchwork/bin/parsemail-batch.sh
+++ b/apps/patchwork/bin/parsemail-batch.sh
@@ -42,7 +42,7 @@ while read line;
do
echo $line
PYTHONPATH="$PATCHWORK_BASE/apps":"$PATCHWORK_BASE/lib/python" \
- DJANGO_SETTINGS_MODULE=settings \
+ DJANGO_SETTINGS_MODULE=apps.settings \
"$PATCHWORK_BASE/apps/patchwork/bin/parsemail.py" < \
"$mail_dir/$line"
done
diff --git a/apps/patchwork/bin/parsemail.py b/apps/patchwork/bin/parsemail.py
index 68bd94c..004ef32 100755
--- a/apps/patchwork/bin/parsemail.py
+++ b/apps/patchwork/bin/parsemail.py
@@ -33,8 +33,8 @@ except ImportError:
from email.Header import Header, decode_header
from email.Utils import parsedate_tz, mktime_tz
-from patchwork.parser import parse_patch
-from patchwork.models import Patch, Project, Person, Comment
+from apps.patchwork.parser import parse_patch
+from apps.patchwork.models import Patch, Project, Person, Comment
list_id_headers = ['List-ID', 'X-Mailing-List']
diff --git a/apps/patchwork/bin/parsemail.sh b/apps/patchwork/bin/parsemail.sh
index 6cac166..0b50172 100755
--- a/apps/patchwork/bin/parsemail.sh
+++ b/apps/patchwork/bin/parsemail.sh
@@ -23,7 +23,7 @@ BIN_DIR=`dirname $0`
PATCHWORK_BASE=`readlink -e $BIN_DIR/../../..`
PYTHONPATH="$PATCHWORK_BASE/apps":"$PATCHWORK_BASE/lib/python" \
- DJANGO_SETTINGS_MODULE=settings \
+ DJANGO_SETTINGS_MODULE=apps.settings \
"$PATCHWORK_BASE/apps/patchwork/bin/parsemail.py"
exit 0
diff --git a/apps/patchwork/bin/rehash.py b/apps/patchwork/bin/rehash.py
index 92cfb20..487552d 100755
--- a/apps/patchwork/bin/rehash.py
+++ b/apps/patchwork/bin/rehash.py
@@ -19,7 +19,7 @@
# along with Patchwork; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from patchwork.models import Patch
+from apps.patchwork.models import Patch
import sys
if __name__ == '__main__':
diff --git a/apps/patchwork/bin/setup.py b/apps/patchwork/bin/setup.py
index 7d55815..d8f0537 100755
--- a/apps/patchwork/bin/setup.py
+++ b/apps/patchwork/bin/setup.py
@@ -20,7 +20,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from patchwork.models import UserProfile
+from apps.patchwork.models import UserProfile
from django.contrib.auth.models import User
# give each existing user a userprofile
diff --git a/apps/patchwork/context_processors.py b/apps/patchwork/context_processors.py
index f4ab5a9..1f62026 100644
--- a/apps/patchwork/context_processors.py
+++ b/apps/patchwork/context_processors.py
@@ -18,8 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from patchwork.models import Bundle
-from patchwork.utils import order_map, get_order
+from apps.patchwork.models import Bundle
+from apps.patchwork.utils import order_map, get_order
def bundle(request):
user = request.user
diff --git a/apps/patchwork/filters.py b/apps/patchwork/filters.py
index 77fc768..88abb81 100644
--- a/apps/patchwork/filters.py
+++ b/apps/patchwork/filters.py
@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from patchwork.models import Person, State
+from apps.patchwork.models import Person, State
from django.utils.safestring import mark_safe
from django.utils.html import escape
from django.contrib.auth.models import User
diff --git a/apps/patchwork/forms.py b/apps/patchwork/forms.py
index f78a105..673ee69 100644
--- a/apps/patchwork/forms.py
+++ b/apps/patchwork/forms.py
@@ -21,7 +21,7 @@
from django.contrib.auth.models import User
from django import forms
-from patchwork.models import Patch, State, Bundle, UserProfile
+from apps.patchwork.models import Patch, State, Bundle, UserProfile
from registration.forms import RegistrationFormUniqueEmail
from registration.models import RegistrationProfile
diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py
index 7653e6c..ffefb11 100644
--- a/apps/patchwork/models.py
+++ b/apps/patchwork/models.py
@@ -22,7 +22,7 @@ from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from django.conf import settings
-from patchwork.parser import hash_patch
+from apps.patchwork.parser import hash_patch
import re
import datetime, time
@@ -281,7 +281,7 @@ class Patch(models.Model):
@models.permalink
def get_absolute_url(self):
- return ('patchwork.views.patch.patch', (), {'patch_id': self.id})
+ return ('apps.patchwork.views.patch.patch', (), {'patch_id': self.id})
class Meta:
verbose_name_plural = 'Patches'
@@ -347,7 +347,7 @@ class Bundle(models.Model):
return None
site = Site.objects.get_current()
return 'http://%s%s' % (site.domain,
- reverse('patchwork.views.bundle.public',
+ reverse('apps.patchwork.views.bundle.public',
kwargs = {
'username': self.owner.username,
'bundlename': self.name
diff --git a/apps/patchwork/requestcontext.py b/apps/patchwork/requestcontext.py
index c1440dd..0ff8e37 100644
--- a/apps/patchwork/requestcontext.py
+++ b/apps/patchwork/requestcontext.py
@@ -21,8 +21,8 @@ from django.template import RequestContext
from django.utils.html import escape
from django.contrib.sites.models import Site
from django.conf import settings
-from patchwork.filters import Filters
-from patchwork.models import Bundle, Project
+from apps.patchwork.filters import Filters
+from apps.patchwork.models import Bundle, Project
def bundle(request):
user = request.user
diff --git a/apps/patchwork/templatetags/listurl.py b/apps/patchwork/templatetags/listurl.py
index 5fe03e4..10c5b88 100644
--- a/apps/patchwork/templatetags/listurl.py
+++ b/apps/patchwork/templatetags/listurl.py
@@ -21,7 +21,7 @@ from django import template
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.encoding import smart_str
-from patchwork.filters import filterclasses
+from apps.patchwork.filters import filterclasses
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
import re
diff --git a/apps/patchwork/templatetags/pwurl.py b/apps/patchwork/templatetags/pwurl.py
index 98bc1ca..c5dcb36 100644
--- a/apps/patchwork/templatetags/pwurl.py
+++ b/apps/patchwork/templatetags/pwurl.py
@@ -20,7 +20,7 @@
from django import template
from django.utils.html import escape
from django.utils.safestring import mark_safe
-from patchwork.filters import filterclasses
+from apps.patchwork.filters import filterclasses
import re
register = template.Library()
diff --git a/apps/patchwork/tests/__init__.py b/apps/patchwork/tests/__init__.py
index 044c8ba..ddabad1 100644
--- a/apps/patchwork/tests/__init__.py
+++ b/apps/patchwork/tests/__init__.py
@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import unittest
-from patchwork.tests import patchparser, encodings, bundles, mboxviews
+from apps.patchwork.tests import patchparser, encodings, bundles, mboxviews
modules = [patchparser, encodings, bundles, mboxviews]
diff --git a/apps/patchwork/tests/bundles.py b/apps/patchwork/tests/bundles.py
index 659500e..f7bc78c 100644
--- a/apps/patchwork/tests/bundles.py
+++ b/apps/patchwork/tests/bundles.py
@@ -20,8 +20,8 @@
import unittest
from django.test import TestCase
from django.test.client import Client
-from patchwork.models import Patch, Bundle, BundlePatch, Person
-from patchwork.tests.utils import defaults, create_user, find_in_context
+from apps.patchwork.models import Patch, Bundle, BundlePatch, Person
+from apps.patchwork.tests.utils import defaults, create_user, find_in_context
class BundleListTest(TestCase):
def setUp(self):
diff --git a/apps/patchwork/tests/encodings.py b/apps/patchwork/tests/encodings.py
index 397b39b..5f9e9f9 100644
--- a/apps/patchwork/tests/encodings.py
+++ b/apps/patchwork/tests/encodings.py
@@ -20,8 +20,8 @@
import unittest
import os
import time
-from patchwork.models import Patch, Person
-from patchwork.tests.utils import defaults, read_patch
+from apps.patchwork.models import Patch, Person
+from apps.patchwork.tests.utils import defaults, read_patch
from django.test import TestCase
from django.test.client import Client
diff --git a/apps/patchwork/tests/mboxviews.py b/apps/patchwork/tests/mboxviews.py
index a3c10cf..ae6f67f 100644
--- a/apps/patchwork/tests/mboxviews.py
+++ b/apps/patchwork/tests/mboxviews.py
@@ -20,8 +20,8 @@
import unittest
from django.test import TestCase
from django.test.client import Client
-from patchwork.models import Patch, Comment, Person
-from patchwork.tests.utils import defaults, create_user, find_in_context
+from apps.patchwork.models import Patch, Comment, Person
+from apps.patchwork.tests.utils import defaults, create_user, find_in_context
class MboxPatchResponseTest(TestCase):
""" Test that the mbox view appends the Acked-by from a patch comment """
diff --git a/apps/patchwork/tests/patchparser.py b/apps/patchwork/tests/patchparser.py
index f6909ce..e0c7f89 100644
--- a/apps/patchwork/tests/patchparser.py
+++ b/apps/patchwork/tests/patchparser.py
@@ -20,8 +20,8 @@
import unittest
import os
from email import message_from_string
-from patchwork.models import Project, Person, Patch, Comment
-from patchwork.tests.utils import read_patch, create_email, defaults
+from apps.patchwork.models import Project, Person, Patch, Comment
+from apps.patchwork.tests.utils import read_patch, create_email, defaults
try:
from email.mime.text import MIMEText
@@ -34,7 +34,7 @@ class PatchTest(unittest.TestCase):
default_subject = defaults.subject
project = defaults.project
-from patchwork.bin.parsemail import find_content, find_author, find_project, \
+from apps.patchwork.bin.parsemail import find_content, find_author, find_project, \
parse_mail
class InlinePatchTest(PatchTest):
diff --git a/apps/patchwork/tests/utils.py b/apps/patchwork/tests/utils.py
index 7166ed2..14bb438 100644
--- a/apps/patchwork/tests/utils.py
+++ b/apps/patchwork/tests/utils.py
@@ -19,7 +19,7 @@
import os
import codecs
-from patchwork.models import Project, Person, UserProfile
+from apps.patchwork.models import Project, Person, UserProfile
from django.contrib.auth.models import User
try:
diff --git a/apps/patchwork/urls.py b/apps/patchwork/urls.py
index b49b4e1..9e4d790 100644
--- a/apps/patchwork/urls.py
+++ b/apps/patchwork/urls.py
@@ -22,46 +22,46 @@ from django.conf import settings
urlpatterns = patterns('',
# Example:
- (r'^$', 'patchwork.views.projects'),
- (r'^project/(?P<project_id>[^/]+)/list/$', 'patchwork.views.patch.list'),
- (r'^project/(?P<project_id>[^/]+)/$', 'patchwork.views.project.project'),
+ (r'^$', 'apps.patchwork.views.projects'),
+ (r'^project/(?P<project_id>[^/]+)/list/$', 'apps.patchwork.views.patch.list'),
+ (r'^project/(?P<project_id>[^/]+)/$', 'apps.patchwork.views.project.project'),
# patch views
- (r'^patch/(?P<patch_id>\d+)/$', 'patchwork.views.patch.patch'),
- (r'^patch/(?P<patch_id>\d+)/raw/$', 'patchwork.views.patch.content'),
- (r'^patch/(?P<patch_id>\d+)/mbox/$', 'patchwork.views.patch.mbox'),
+ (r'^patch/(?P<patch_id>\d+)/$', 'apps.patchwork.views.patch.patch'),
+ (r'^patch/(?P<patch_id>\d+)/raw/$', 'apps.patchwork.views.patch.content'),
+ (r'^patch/(?P<patch_id>\d+)/mbox/$', 'apps.patchwork.views.patch.mbox'),
# logged-in user stuff
- (r'^user/$', 'patchwork.views.user.profile'),
- (r'^user/todo/$', 'patchwork.views.user.todo_lists'),
- (r'^user/todo/(?P<project_id>[^/]+)/$', 'patchwork.views.user.todo_list'),
+ (r'^user/$', 'apps.patchwork.views.user.profile'),
+ (r'^user/todo/$', 'apps.patchwork.views.user.todo_lists'),
+ (r'^user/todo/(?P<project_id>[^/]+)/$', 'apps.patchwork.views.user.todo_list'),
(r'^user/bundles/$',
- 'patchwork.views.bundle.bundles'),
+ 'apps.patchwork.views.bundle.bundles'),
(r'^user/bundle/(?P<bundle_id>[^/]+)/$',
- 'patchwork.views.bundle.bundle'),
+ 'apps.patchwork.views.bundle.bundle'),
(r'^user/bundle/(?P<bundle_id>[^/]+)/mbox/$',
- 'patchwork.views.bundle.mbox'),
+ 'apps.patchwork.views.bundle.mbox'),
- (r'^user/link/$', 'patchwork.views.user.link'),
- (r'^user/link/(?P<key>[^/]+)/$', 'patchwork.views.user.link_confirm'),
- (r'^user/unlink/(?P<person_id>[^/]+)/$', 'patchwork.views.user.unlink'),
+ (r'^user/link/$', 'apps.patchwork.views.user.link'),
+ (r'^user/link/(?P<key>[^/]+)/$', 'apps.patchwork.views.user.link_confirm'),
+ (r'^user/unlink/(?P<person_id>[^/]+)/$', 'apps.patchwork.views.user.unlink'),
# public view for bundles
(r'^bundle/(?P<username>[^/]*)/(?P<bundlename>[^/]*)/$',
- 'patchwork.views.bundle.public'),
+ 'apps.patchwork.views.bundle.public'),
# submitter autocomplete
- (r'^submitter/$', 'patchwork.views.submitter_complete'),
+ (r'^submitter/$', 'apps.patchwork.views.submitter_complete'),
# help!
- (r'^help/(?P<path>.*)$', 'patchwork.views.help'),
+ (r'^help/(?P<path>.*)$', 'apps.patchwork.views.help'),
)
if settings.ENABLE_XMLRPC:
urlpatterns += patterns('',
- (r'xmlrpc/$', 'patchwork.views.xmlrpc.xmlrpc'),
- (r'^pwclient/$', 'patchwork.views.pwclient'),
+ (r'xmlrpc/$', 'apps.patchwork.views.xmlrpc.xmlrpc'),
+ (r'^pwclient/$', 'apps.patchwork.views.pwclient'),
(r'^project/(?P<project_id>[^/]+)/pwclientrc/$',
- 'patchwork.views.pwclientrc'),
+ 'apps.patchwork.views.pwclientrc'),
)
diff --git a/apps/patchwork/utils.py b/apps/patchwork/utils.py
index fa26aef..e83747e 100644
--- a/apps/patchwork/utils.py
+++ b/apps/patchwork/utils.py
@@ -18,8 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from patchwork.forms import MultiplePatchForm
-from patchwork.models import Bundle, Project, BundlePatch, State, UserProfile
+from apps.patchwork.forms import MultiplePatchForm
+from apps.patchwork.models import Bundle, Project, BundlePatch, State, UserProfile
from django.conf import settings
from django.shortcuts import render_to_response, get_object_or_404
diff --git a/apps/patchwork/views/__init__.py b/apps/patchwork/views/__init__.py
index 3f50380..afe2b65 100644
--- a/apps/patchwork/views/__init__.py
+++ b/apps/patchwork/views/__init__.py
@@ -19,9 +19,9 @@
from base import *
-from patchwork.utils import Order, get_patch_ids, set_patches
-from patchwork.paginator import Paginator
-from patchwork.forms import MultiplePatchForm
+from apps.patchwork.utils import Order, get_patch_ids, set_patches
+from apps.patchwork.paginator import Paginator
+from apps.patchwork.forms import MultiplePatchForm
def generic_list(request, project, view,
view_args = {}, filter_settings = [], patches = None,
diff --git a/apps/patchwork/views/base.py b/apps/patchwork/views/base.py
index 338c673..85ec547 100644
--- a/apps/patchwork/views/base.py
+++ b/apps/patchwork/views/base.py
@@ -18,15 +18,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from patchwork.models import Patch, Project, Person
-from patchwork.filters import Filters
-from patchwork.forms import LoginForm, PatchForm
+from apps.patchwork.models import Patch, Project, Person
+from apps.patchwork.filters import Filters
+from apps.patchwork.forms import LoginForm, PatchForm
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.db import transaction
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
-from patchwork.requestcontext import PatchworkRequestContext
+from apps.patchwork.requestcontext import PatchworkRequestContext
from django.core import serializers, urlresolvers
from django.template.loader import render_to_string
from django.conf import settings
@@ -37,7 +37,7 @@ def projects(request):
if projects.count() == 1:
return HttpResponseRedirect(
- urlresolvers.reverse('patchwork.views.patch.list',
+ urlresolvers.reverse('apps.patchwork.views.patch.list',
kwargs = {'project_id': projects[0].linkname}))
context['projects'] = projects
diff --git a/apps/patchwork/views/bundle.py b/apps/patchwork/views/bundle.py
index 9995fc6..b4df68c 100644
--- a/apps/patchwork/views/bundle.py
+++ b/apps/patchwork/views/bundle.py
@@ -20,15 +20,15 @@
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.shortcuts import render_to_response, get_object_or_404
-from patchwork.requestcontext import PatchworkRequestContext
+from apps.patchwork.requestcontext import PatchworkRequestContext
from django.http import HttpResponse, HttpResponseRedirect
import django.core.urlresolvers
-from patchwork.models import Patch, Bundle, BundlePatch, Project
-from patchwork.utils import get_patch_ids
-from patchwork.forms import BundleForm, DeleteBundleForm
-from patchwork.views import generic_list
-from patchwork.filters import DelegateFilter
-from patchwork.paginator import Paginator
+from apps.patchwork.models import Patch, Bundle, BundlePatch, Project
+from apps.patchwork.utils import get_patch_ids
+from apps.patchwork.forms import BundleForm, DeleteBundleForm
+from apps.patchwork.views import generic_list
+from apps.patchwork.filters import DelegateFilter
+from apps.patchwork.paginator import Paginator
@login_required
def setbundle(request):
@@ -93,14 +93,14 @@ def setbundle(request):
if bundle:
return HttpResponseRedirect(
django.core.urlresolvers.reverse(
- 'patchwork.views.bundle.bundle',
+ 'apps.patchwork.views.bundle.bundle',
kwargs = {'bundle_id': bundle.id}
)
)
else:
return HttpResponseRedirect(
django.core.urlresolvers.reverse(
- 'patchwork.views.bundle.list')
+ 'apps.patchwork.views.bundle.list')
)
@login_required
@@ -137,7 +137,7 @@ def bundle(request, bundle_id):
bundle.delete()
return HttpResponseRedirect(
django.core.urlresolvers.reverse(
- 'patchwork.views.user.profile')
+ 'apps.patchwork.views.user.profile')
)
elif action == 'update':
form = BundleForm(request.POST, instance = bundle)
@@ -158,7 +158,7 @@ def bundle(request, bundle_id):
order += 1
context = generic_list(request, bundle.project,
- 'patchwork.views.bundle.bundle',
+ 'apps.patchwork.views.bundle.bundle',
view_args = {'bundle_id': bundle_id},
filter_settings = filter_settings,
patches = bundle.ordered_patches(),
@@ -183,7 +183,7 @@ def public(request, username, bundlename):
bundle = get_object_or_404(Bundle, name = bundlename, public = True)
filter_settings = [(DelegateFilter, DelegateFilter.AnyDelegate)]
context = generic_list(request, bundle.project,
- 'patchwork.views.bundle.public',
+ 'apps.patchwork.views.bundle.public',
view_args = {'username': username, 'bundlename': bundlename},
filter_settings = filter_settings,
patches = bundle.patches.all())
diff --git a/apps/patchwork/views/patch.py b/apps/patchwork/views/patch.py
index 49843eb..7ecde5e 100644
--- a/apps/patchwork/views/patch.py
+++ b/apps/patchwork/views/patch.py
@@ -18,11 +18,11 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from patchwork.models import Patch, Project, Person, Bundle
-from patchwork.filters import Filters
-from patchwork.forms import PatchForm, MultiplePatchForm, CreateBundleForm
-from patchwork.utils import get_patch_ids, set_patches, Order
-from patchwork.requestcontext import PatchworkRequestContext
+from apps.patchwork.models import Patch, Project, Person, Bundle
+from apps.patchwork.filters import Filters
+from apps.patchwork.forms import PatchForm, MultiplePatchForm, CreateBundleForm
+from apps.patchwork.utils import get_patch_ids, set_patches, Order
+from apps.patchwork.requestcontext import PatchworkRequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect, \
HttpResponseForbidden
@@ -30,8 +30,8 @@ from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login
import django.core.urlresolvers
-from patchwork.paginator import Paginator
-from patchwork.views import generic_list
+from apps.patchwork.paginator import Paginator
+from apps.patchwork.views import generic_list
def patch(request, patch_id):
context = PatchworkRequestContext(request)
@@ -128,12 +128,12 @@ def mbox(request, patch_id):
def list(request, project_id):
project = get_object_or_404(Project, linkname=project_id)
- context = generic_list(request, project, 'patchwork.views.patch.list',
+ context = generic_list(request, project, 'apps.patchwork.views.patch.list',
view_args = {'project_id': project.linkname})
return render_to_response('patchwork/list.html', context)
context = PatchworkRequestContext(request,
- list_view = 'patchwork.views.patch.list',
+ list_view = 'apps.patchwork.views.patch.list',
list_view_params = {'project_id': project_id})
order = get_order(request)
project = get_object_or_404(Project, linkname=project_id)
diff --git a/apps/patchwork/views/project.py b/apps/patchwork/views/project.py
index 798e8a7..922144d 100644
--- a/apps/patchwork/views/project.py
+++ b/apps/patchwork/views/project.py
@@ -18,11 +18,11 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from patchwork.models import Patch, Project, Person
+from apps.patchwork.models import Patch, Project, Person
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
-from patchwork.requestcontext import PatchworkRequestContext
+from apps.patchwork.requestcontext import PatchworkRequestContext
def project(request, project_id):
context = PatchworkRequestContext(request)
diff --git a/apps/patchwork/views/user.py b/apps/patchwork/views/user.py
index f9ff7f8..359c786 100644
--- a/apps/patchwork/views/user.py
+++ b/apps/patchwork/views/user.py
@@ -19,18 +19,18 @@
from django.contrib.auth.decorators import login_required
-from patchwork.requestcontext import PatchworkRequestContext
+from apps.patchwork.requestcontext import PatchworkRequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib import auth
from django.http import HttpResponse, HttpResponseRedirect
-from patchwork.models import Project, Patch, Bundle, Person, UserProfile, \
+from apps.patchwork.models import Project, Patch, Bundle, Person, UserProfile, \
UserPersonConfirmation, State
-from patchwork.forms import MultiplePatchForm, UserProfileForm, \
+from apps.patchwork.forms import MultiplePatchForm, UserProfileForm, \
UserPersonLinkForm
-from patchwork.utils import Order, get_patch_ids
-from patchwork.filters import DelegateFilter
-from patchwork.paginator import Paginator
-from patchwork.views import generic_list
+from apps.patchwork.utils import Order, get_patch_ids
+from apps.patchwork.filters import DelegateFilter
+from apps.patchwork.paginator import Paginator
+from apps.patchwork.views import generic_list
from django.template.loader import render_to_string
from django.template import Context
from django.conf import settings
@@ -109,7 +109,7 @@ def unlink(request, person_id):
person.user = None
person.save()
- url = django.core.urlresolvers.reverse('patchwork.views.user.profile')
+ url = django.core.urlresolvers.reverse('apps.patchwork.views.user.profile')
return HttpResponseRedirect(url)
@@ -140,7 +140,7 @@ def todo_list(request, project_id):
{'delegate': request.user})]
context = generic_list(request, project,
- 'patchwork.views.user.todo_list',
+ 'apps.patchwork.views.user.todo_list',
view_args = {'project_id': project.linkname},
filter_settings = filter_settings,
patches = patches)
diff --git a/apps/patchwork/views/xmlrpc.py b/apps/patchwork/views/xmlrpc.py
index 23e58bf..d9b5b8a 100644
--- a/apps/patchwork/views/xmlrpc.py
+++ b/apps/patchwork/views/xmlrpc.py
@@ -28,7 +28,7 @@ from django.conf import settings
from django.core import urlresolvers
from django.shortcuts import render_to_response
from django.contrib.auth import authenticate
-from patchwork.models import Patch, Project, Person, Bundle, State
+from apps.patchwork.models import Patch, Project, Person, Bundle, State
import sys
import base64
@@ -123,7 +123,7 @@ dispatcher = PatchworkXMLRPCDispatcher()
def xmlrpc(request):
if request.method != 'POST':
return HttpResponseRedirect(
- urlresolvers.reverse('patchwork.views.help',
+ urlresolvers.reverse('apps.patchwork.views.help',
kwargs = {'path': 'pwclient/'}))
response = HttpResponse()
diff --git a/apps/settings.py b/apps/settings.py
index 20c8db3..ccd0f5a 100644
--- a/apps/settings.py
+++ b/apps/settings.py
@@ -89,7 +89,7 @@ INSTALLED_APPS = (
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
- 'patchwork',
+ 'apps.patchwork',
'registration',
)
diff --git a/apps/urls.py b/apps/urls.py
index 5c4ac57..85bd8c6 100644
--- a/apps/urls.py
+++ b/apps/urls.py
@@ -19,15 +19,15 @@
from django.conf.urls.defaults import *
from django.conf import settings
-from patchwork.admin import admin_site
+from apps.patchwork.admin import admin_site
from registration.views import register
-from patchwork.forms import RegistrationForm
-from patchwork.utils import userprofile_register_callback
+from apps.patchwork.forms import RegistrationForm
+from apps.patchwork.utils import userprofile_register_callback
urlpatterns = patterns('',
# Example:
- (r'^', include('patchwork.urls')),
+ (r'^', include('apps.patchwork.urls')),
# override the default registration form
url(r'^accounts/register/$',
--
1.5.6.5
More information about the Patchwork
mailing list