Finally got around to creating admin.py files for all of the apps. This will prevent some really weird import errors and fixes an issue with the Attribute model's admin display. May also cut resource usage slightly for MUD server instances. Needs more testing!
This commit is contained in:
parent
1da2179ee6
commit
573d1b6e88
9 changed files with 49 additions and 62 deletions
9
src/helpsys/admin.py
Normal file
9
src/helpsys/admin.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from django.contrib import admin
|
||||
from src.helpsys.models import HelpEntry
|
||||
|
||||
class HelpEntryAdmin(admin.ModelAdmin):
|
||||
list_display = ('id', 'topicname', 'staff_only')
|
||||
list_display_links = ('id', 'topicname')
|
||||
list_filter = ('staff_only',)
|
||||
search_fields = ['topicname', 'entrytext']
|
||||
admin.site.register(HelpEntry, HelpEntryAdmin)
|
||||
|
|
@ -2,9 +2,8 @@
|
|||
Models for the help system.
|
||||
"""
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from src import ansi
|
||||
from src.helpsys.managers.helpentry import HelpEntryManager
|
||||
from src.helpsys.managers import HelpEntryManager
|
||||
|
||||
class HelpEntry(models.Model):
|
||||
"""
|
||||
|
|
@ -33,11 +32,4 @@ class HelpEntry(models.Model):
|
|||
"""
|
||||
Gets the entry text for in-game viewing.
|
||||
"""
|
||||
return ansi.parse_ansi(self.entrytext)
|
||||
|
||||
class HelpEntryAdmin(admin.ModelAdmin):
|
||||
list_display = ('id', 'topicname', 'staff_only')
|
||||
list_display_links = ('id', 'topicname')
|
||||
list_filter = ('staff_only',)
|
||||
search_fields = ['topicname', 'entrytext']
|
||||
admin.site.register(HelpEntry, HelpEntryAdmin)
|
||||
return ansi.parse_ansi(self.entrytext)
|
||||
Loading…
Add table
Add a link
Reference in a new issue