Commit 7b17322843c9e777f619e499889691b84ccc973f
1 parent
5df4e81c
Exists in
master
and in
39 other branches
Moving super_archives stuff
Showing
6 changed files
with
14 additions
and
16 deletions
Show diff stats
src/super_archives/admin.py
| 1 | 1 | ||
| 2 | from django.contrib import admin | 2 | from django.contrib import admin |
| 3 | -from colab.super_archives.models import Message, Thread, UserProfile | 3 | +from .models import Message, Thread, UserProfile |
| 4 | 4 | ||
| 5 | class MessageAdmin(admin.ModelAdmin): | 5 | class MessageAdmin(admin.ModelAdmin): |
| 6 | list_filter = ('spam', 'thread__mailinglist', 'received_time', ) | 6 | list_filter = ('spam', 'thread__mailinglist', 'received_time', ) |
src/super_archives/forms.py
| @@ -6,8 +6,8 @@ from django.contrib.auth.models import User | @@ -6,8 +6,8 @@ from django.contrib.auth.models import User | ||
| 6 | from django.contrib.auth.forms import UserCreationForm as UserCreationForm_ | 6 | from django.contrib.auth.forms import UserCreationForm as UserCreationForm_ |
| 7 | from django.utils.translation import ugettext_lazy as _ | 7 | from django.utils.translation import ugettext_lazy as _ |
| 8 | 8 | ||
| 9 | -from colab.super_archives.models import MailingList | ||
| 10 | -from colab.super_archives.validators import UniqueValidator | 9 | +from .models import MailingList |
| 10 | +from .validators import UniqueValidator | ||
| 11 | 11 | ||
| 12 | # XXX: I know that this code does not look nice AT ALL. | 12 | # XXX: I know that this code does not look nice AT ALL. |
| 13 | # probably it should be implemented using formsets instead of | 13 | # probably it should be implemented using formsets instead of |
src/super_archives/management/commands/import_emails.py
| @@ -13,10 +13,8 @@ from django.db import transaction | @@ -13,10 +13,8 @@ from django.db import transaction | ||
| 13 | from django.template.defaultfilters import slugify | 13 | from django.template.defaultfilters import slugify |
| 14 | from django.core.management.base import BaseCommand, CommandError | 14 | from django.core.management.base import BaseCommand, CommandError |
| 15 | 15 | ||
| 16 | -from colab.super_archives.models import MailingList, Message, \ | ||
| 17 | - Thread, EmailAddress | ||
| 18 | -from colab.super_archives.management.commands.message import Message as \ | ||
| 19 | - CustomMessage | 16 | +from super_archives.models import MailingList, Message, Thread, EmailAddress |
| 17 | +from super_archives.management.commands.message import Message as CustomMessage | ||
| 20 | 18 | ||
| 21 | 19 | ||
| 22 | class Command(BaseCommand, object): | 20 | class Command(BaseCommand, object): |
src/super_archives/queries.py
| 1 | 1 | ||
| 2 | from django.core.exceptions import ObjectDoesNotExist | 2 | from django.core.exceptions import ObjectDoesNotExist |
| 3 | -from colab.super_archives.models import Thread, Vote, Message, PageHit | 3 | +from .models import Thread, Vote, Message, PageHit |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | def get_messages_by_date(): | 6 | def get_messages_by_date(): |
src/super_archives/urls.py
| 1 | from django.conf.urls.defaults import patterns, include, url | 1 | from django.conf.urls.defaults import patterns, include, url |
| 2 | 2 | ||
| 3 | -urlpatterns = patterns('', | ||
| 4 | -# url(r'thread/(?P<thread>\d+)/$', 'super_archives.views.thread', name='thread'), | ||
| 5 | - url(r'thread/(?P<mailinglist>[-\w]+)/(?P<thread_token>[-\w]+)$', | ||
| 6 | - 'colab.super_archives.views.thread', name="thread_view"), | ||
| 7 | - url(r'thread/$', | ||
| 8 | - 'colab.super_archives.views.list_messages', name='thread_list') | 3 | +urlpatterns = patterns('super_archives.views', |
| 4 | +# url(r'thread/(?P<thread>\d+)/$', 'thread', name='thread'), | ||
| 5 | + url(r'thread/(?P<mailinglist>[-\w]+)/(?P<thread_token>[-\w]+)$', 'thread', | ||
| 6 | + name="thread_view"), | ||
| 7 | + url(r'thread/$', 'list_messages', name='thread_list') | ||
| 9 | ) | 8 | ) |
src/super_archives/views.py
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | 2 | ||
| 3 | +import queries | ||
| 4 | + | ||
| 3 | from django.http import Http404 | 5 | from django.http import Http404 |
| 4 | from django.template import RequestContext | 6 | from django.template import RequestContext |
| 5 | from django.core.paginator import Paginator | 7 | from django.core.paginator import Paginator |
| 6 | from django.core.exceptions import ObjectDoesNotExist | 8 | from django.core.exceptions import ObjectDoesNotExist |
| 7 | from django.shortcuts import render_to_response, get_list_or_404 | 9 | from django.shortcuts import render_to_response, get_list_or_404 |
| 8 | 10 | ||
| 9 | -from colab.super_archives import queries | ||
| 10 | -from colab.super_archives.models import MailingList, Thread | 11 | +from .models import MailingList, Thread |
| 11 | 12 | ||
| 12 | 13 | ||
| 13 | def thread(request, mailinglist, thread_token): | 14 | def thread(request, mailinglist, thread_token): |