Django admin functionality restored.
This commit is contained in:
parent
75c38ada19
commit
3041684ba3
6 changed files with 26 additions and 13 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.contrib import admin
|
||||||
from apps.config.managers.commandalias import CommandAliasManager
|
from apps.config.managers.commandalias import CommandAliasManager
|
||||||
from apps.config.managers.configvalue import ConfigValueManager
|
from apps.config.managers.configvalue import ConfigValueManager
|
||||||
from apps.config.managers.connectscreen import ConnectScreenManager
|
from apps.config.managers.connectscreen import ConnectScreenManager
|
||||||
|
|
@ -19,6 +20,7 @@ class CommandAlias(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name_plural = "Command aliases"
|
verbose_name_plural = "Command aliases"
|
||||||
ordering = ['user_input']
|
ordering = ['user_input']
|
||||||
|
admin.site.register(CommandAlias)
|
||||||
|
|
||||||
class ConfigValue(models.Model):
|
class ConfigValue(models.Model):
|
||||||
"""
|
"""
|
||||||
|
|
@ -34,6 +36,7 @@ class ConfigValue(models.Model):
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s" % self.conf_key
|
return "%s" % self.conf_key
|
||||||
|
admin.site.register(ConfigValue)
|
||||||
|
|
||||||
class ConnectScreen(models.Model):
|
class ConnectScreen(models.Model):
|
||||||
"""
|
"""
|
||||||
|
|
@ -48,3 +51,4 @@ class ConnectScreen(models.Model):
|
||||||
|
|
||||||
class Admin:
|
class Admin:
|
||||||
list_display = ('id', 'name', 'is_active')
|
list_display = ('id', 'name', 'is_active')
|
||||||
|
admin.site.register(ConnectScreen)
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
Models for the help system.
|
Models for the help system.
|
||||||
"""
|
"""
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.contrib import admin
|
||||||
from src import ansi
|
from src import ansi
|
||||||
from apps.helpsys.managers.helpentry import HelpEntryManager
|
from apps.helpsys.managers.helpentry import HelpEntryManager
|
||||||
|
|
||||||
|
|
@ -45,3 +45,4 @@ class HelpEntry(models.Model):
|
||||||
return ansi.parse_ansi(self.entrytext)
|
return ansi.parse_ansi(self.entrytext)
|
||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
|
admin.site.register(HelpEntry)
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.auth.models import User, Group
|
from django.contrib.auth.models import User, Group
|
||||||
|
from django.contrib import admin
|
||||||
from apps.config.models import ConfigValue
|
from apps.config.models import ConfigValue
|
||||||
from apps.objects.util import object as util_object
|
from apps.objects.util import object as util_object
|
||||||
from apps.objects.managers.commchannel import CommChannelManager
|
from apps.objects.managers.commchannel import CommChannelManager
|
||||||
|
|
@ -87,6 +86,7 @@ class Attribute(models.Model):
|
||||||
self.get_name(),
|
self.get_name(),
|
||||||
ansi.ansi["normal"],
|
ansi.ansi["normal"],
|
||||||
self.get_value())
|
self.get_value())
|
||||||
|
admin.site.register(Attribute)
|
||||||
|
|
||||||
class Object(models.Model):
|
class Object(models.Model):
|
||||||
"""
|
"""
|
||||||
|
|
@ -827,6 +827,7 @@ class Object(models.Model):
|
||||||
# about tuple index types. Bleh.
|
# about tuple index types. Bleh.
|
||||||
otype = int(self.type)
|
otype = int(self.type)
|
||||||
return defines_global.OBJECT_TYPES[otype][1][0]
|
return defines_global.OBJECT_TYPES[otype][1][0]
|
||||||
|
admin.site.register(Object)
|
||||||
|
|
||||||
class CommChannel(models.Model):
|
class CommChannel(models.Model):
|
||||||
"""
|
"""
|
||||||
|
|
@ -892,6 +893,7 @@ class CommChannel(models.Model):
|
||||||
"""
|
"""
|
||||||
self.owner = new_owner
|
self.owner = new_owner
|
||||||
self.save()
|
self.save()
|
||||||
|
admin.site.register(CommChannel)
|
||||||
|
|
||||||
class CommChannelMessage(models.Model):
|
class CommChannelMessage(models.Model):
|
||||||
"""
|
"""
|
||||||
|
|
@ -911,3 +913,4 @@ class CommChannelMessage(models.Model):
|
||||||
|
|
||||||
class Admin:
|
class Admin:
|
||||||
list_display = ('channel', 'message')
|
list_display = ('channel', 'message')
|
||||||
|
admin.site.register(CommChannelMessage)
|
||||||
20
urls.py
20
urls.py
|
|
@ -7,24 +7,26 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
from django.conf.urls.defaults import *
|
from django.conf.urls.defaults import *
|
||||||
import settings
|
from django.conf import settings
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
urlpatterns = patterns('',
|
urlpatterns = patterns('',
|
||||||
# User Authentication
|
# User Authentication
|
||||||
(r'^accounts/login', 'django.contrib.auth.views.login'),
|
url(r'^accounts/login', 'django.contrib.auth.views.login'),
|
||||||
(r'^accounts/logout', 'django.contrib.auth.views.logout'),
|
url(r'^accounts/logout', 'django.contrib.auth.views.logout'),
|
||||||
|
|
||||||
# Admin interface
|
|
||||||
(r'^admin/', include('django.contrib.admin.urls')),
|
|
||||||
|
|
||||||
# Front page
|
# Front page
|
||||||
(r'^', include('webapps.website.urls')),
|
url(r'^', include('webapps.website.urls')),
|
||||||
|
|
||||||
# News stuff
|
# News stuff
|
||||||
(r'^news/', include('webapps.news.urls')),
|
url(r'^news/', include('webapps.news.urls')),
|
||||||
|
|
||||||
# Page place-holder for things that aren't implemented yet.
|
# Page place-holder for things that aren't implemented yet.
|
||||||
(r'^tbi/', 'webapps.website.views.to_be_implemented'),
|
url(r'^tbi/', 'webapps.website.views.to_be_implemented'),
|
||||||
|
|
||||||
|
# Admin interface
|
||||||
|
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
||||||
|
url(r'^admin/(.*)', admin.site.root, name='admin'),
|
||||||
)
|
)
|
||||||
|
|
||||||
# If you'd like to serve media files via Django (strongly not recommended!),
|
# If you'd like to serve media files via Django (strongly not recommended!),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.contrib import admin
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
class NewsTopic(models.Model):
|
class NewsTopic(models.Model):
|
||||||
|
|
@ -20,6 +21,7 @@ class NewsTopic(models.Model):
|
||||||
|
|
||||||
class Admin:
|
class Admin:
|
||||||
list_display = ('name', 'icon')
|
list_display = ('name', 'icon')
|
||||||
|
admin.site.register(NewsTopic)
|
||||||
|
|
||||||
class NewsEntry(models.Model):
|
class NewsEntry(models.Model):
|
||||||
"""
|
"""
|
||||||
|
|
@ -42,3 +44,4 @@ class NewsEntry(models.Model):
|
||||||
list_display = ('title', 'author', 'topic', 'date_posted')
|
list_display = ('title', 'author', 'topic', 'date_posted')
|
||||||
list_filter = ('topic',)
|
list_filter = ('topic',)
|
||||||
search_fields = ['title']
|
search_fields = ['title']
|
||||||
|
admin.site.register(NewsEntry)
|
||||||
|
|
@ -10,7 +10,7 @@ from django.template import RequestContext
|
||||||
import django.views.generic.list_detail as gv_list_detail
|
import django.views.generic.list_detail as gv_list_detail
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django import newforms as forms
|
from django import forms
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
from webapps.news.models import NewsTopic, NewsEntry
|
from webapps.news.models import NewsTopic, NewsEntry
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue