Removed admin

This commit is contained in:
Martin Mahner 2011-06-03 08:56:11 +00:00
parent 04e1b17b58
commit bd77201b0a
4 changed files with 2 additions and 22 deletions

View file

@ -1,14 +0,0 @@
from pastebin.apps.dpaste.models import Snippet, Spamword
from django.contrib import admin
class SnippetAdmin(admin.ModelAdmin):
list_display = (
'__unicode__',
'author',
'lexer',
'published',
'expires',
)
admin.site.register(Snippet, SnippetAdmin)
admin.site.register(Spamword)

View file

@ -125,7 +125,8 @@ def userprefs(request, template_name='dpaste/userprefs.html'):
def snippet_diff(request, template_name='dpaste/snippet_diff.html'): def snippet_diff(request, template_name='dpaste/snippet_diff.html'):
if request.GET.get('a').isdigit() and request.GET.get('b').isdigit(): if request.GET.get('a') and request.GET.get('a').isdigit() \
and request.GET.get('b') and request.GET.get('b').isdigit():
try: try:
fileA = Snippet.objects.get(pk=int(request.GET.get('a'))) fileA = Snippet.objects.get(pk=int(request.GET.get('a')))
fileB = Snippet.objects.get(pk=int(request.GET.get('b'))) fileB = Snippet.objects.get(pk=int(request.GET.get('b')))

View file

@ -96,7 +96,6 @@ INSTALLED_APPS = (
'django.contrib.contenttypes', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.sites', 'django.contrib.sites',
'django.contrib.admin',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'mptt', 'mptt',
'pastebin', 'pastebin',

View file

@ -1,7 +1,6 @@
from django.conf.urls.defaults import * from django.conf.urls.defaults import *
from django.conf import settings from django.conf import settings
from django.contrib import admin from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from piston.resource import Resource from piston.resource import Resource
from pastebin.apps.api.handlers import SnippetHandler from pastebin.apps.api.handlers import SnippetHandler
@ -14,13 +13,8 @@ urlpatterns = patterns('',
# Static # Static
url(r'^about/$', 'django.views.generic.simple.direct_to_template', {'template': 'about.html'}, name='about'), url(r'^about/$', 'django.views.generic.simple.direct_to_template', {'template': 'about.html'}, name='about'),
# Bla
(r'^i18n/', include('django.conf.urls.i18n')),
(r'^admin/', include(admin.site.urls)),
# API # API
url(r'^api/(?P<secret_id>[^/]+)/$', snippet_resource), url(r'^api/(?P<secret_id>[^/]+)/$', snippet_resource),
url(r'^api/$', snippet_resource), url(r'^api/$', snippet_resource),
) )
urlpatterns += staticfiles_urlpatterns()