remove admin, add plugin system for openslides

This commit is contained in:
Oskar Hahn 2012-04-13 14:05:51 +02:00
parent f889c49c1b
commit bb430fd2a7
6 changed files with 20 additions and 69 deletions

View File

@ -1,18 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.agenda.admin
~~~~~~~~~~~~~~~~~~~~~~~
Register app for admin site.
:copyright: 2011 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from django.contrib import admin
from mptt.admin import MPTTModelAdmin
from openslides.agenda.models import Item
admin.site.register(Item, MPTTModelAdmin)

View File

@ -1,17 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.application.admin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Register app for admin site.
:copyright: 2011 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from django.contrib import admin
from openslides.application.models import Application, AVersion
admin.site.register(Application)
admin.site.register(AVersion)

View File

@ -1,16 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.assignment.admin
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Register app for admin site.
:copyright: 2011 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from django.contrib import admin
from assignment.models import Assignment
admin.site.register(Assignment)

View File

@ -22,3 +22,11 @@ LANGUAGE_CODE = 'de'
# Make this unique, and don't share it with anybody.
SECRET_KEY = '=(v@$58k$fcl4y8t2#q15y-9p=^45y&!$!ap$7xo6ub$akg-!5'
# Put your OpenSlides Plugins in this List
INSTALLED_PLUGINS = (
)
INSTALLED_APPS += INSTALLED_PLUGINS

View File

@ -1,16 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.participant.admin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Register app for admin site.
:copyright: 2011 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from django.contrib import admin
from participant.models import Profile
admin.site.register(Profile)

View File

@ -14,12 +14,13 @@ from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
from django.views.generic import RedirectView
from django.utils.importlib import import_module
import settings
admin.autodiscover()
handler500 = 'openslides.utils.views.server_error'
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
# frontpage
(r'^$', RedirectView.as_view(
url='projector/control',
@ -36,6 +37,15 @@ urlpatterns = patterns('',
(r'^i18n/', include('django.conf.urls.i18n')),
)
for plugin in settings.INSTALLED_PLUGINS:
try:
mod = import_module(plugin + '.urls')
except (ImportError):
continue
plugin_name = mod.__name__.split('.')[0]
urlpatterns += patterns('', (r'^%s/' % plugin_name, include('%s.urls' % plugin_name)))
urlpatterns += patterns('',
(r'^500/$', 'openslides.utils.views.server_error'),