Changeset 2059
- Timestamp:
- 06/23/09 11:20:54 (9 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/0.9/pylucid_project/apps/pylucid/admin.py
r2057 r2059 55 55 56 56 list_display = ( 57 " slug", "site", "get_absolute_url", "description",57 "id", "slug", "site", "get_absolute_url", "description", 58 58 "lastupdatetime", "lastupdateby" 59 59 ) … … 73 73 74 74 class PageMetaAdmin(VersionAdmin): 75 list_display = (" title_or_slug", "get_absolute_url", "get_site", "lastupdatetime", "lastupdateby",)75 list_display = ("id", "title_or_slug", "get_absolute_url", "get_site", "lastupdatetime", "lastupdateby",) 76 76 list_display_links = ("title_or_slug", "get_absolute_url") 77 77 list_filter = ("lang", "keywords", "createby", "lastupdateby") 78 78 date_hierarchy = 'lastupdatetime' 79 79 search_fields = ("description", "keywords") 80 80 81 81 82 admin.site.register(models.PageMeta, PageMetaAdmin) 82 83 84 class PageContentInline(admin.StackedInline): 85 model = models.PageContent 83 86 84 87 class PageContentAdmin(VersionAdmin): 85 list_display = (" title_or_slug", "get_absolute_url", "get_site", "lastupdatetime", "lastupdateby",)88 list_display = ("id", "title_or_slug", "get_absolute_url", "get_site", "lastupdatetime", "lastupdateby",) 86 89 list_display_links = ("title_or_slug", "get_absolute_url") 87 90 list_filter = ("lang", "markup", "createby", "lastupdateby",) … … 94 97 class PluginPageAdmin(VersionAdmin): 95 98 list_display = ( 96 "get_plugin_name", "get_absolute_url", "app_label", "get_site", "lastupdatetime", "lastupdateby", 99 "id", "get_plugin_name", "get_absolute_url", "app_label", 100 "get_site", "lastupdatetime", "lastupdateby", 97 101 ) 98 102 list_display_links = ("get_plugin_name", "app_label") … … 113 117 114 118 class ColorSchemeAdmin(VersionAdmin): 115 list_display = (" name",)119 list_display = ("id", "name", "preview", "lastupdatetime", "lastupdateby") 116 120 list_display_links = ("name",) 117 121 search_fields = ("name",) 118 inlines = [ 119 ColorInline, 120 ] 122 inlines = [ColorInline,] 123 124 def preview(self, obj): 125 colors = models.Color.objects.all().filter(colorscheme=obj) 126 result = "" 127 for color in colors: 128 result += '<span style="background-color:#%s;" title="%s"> </span>' % ( 129 color.value, color.name 130 ) 131 return result 132 preview.short_description = 'color preview' 133 preview.allow_tags = True 121 134 122 135 admin.site.register(models.ColorScheme, ColorSchemeAdmin) 123 136 124 137 125 126 138 class DesignAdmin(VersionAdmin): 127 list_display = (" name", "template", "colorscheme", "lastupdatetime", "lastupdateby")139 list_display = ("id", "name", "template", "colorscheme", "lastupdatetime", "lastupdateby") 128 140 list_display_links = ("name",) 129 141 list_filter = ("site", "template", "colorscheme", "createby", "lastupdateby") … … 134 146 135 147 class EditableHtmlHeadFileAdmin(VersionAdmin): 136 list_display = (" filepath", "render", "description", "lastupdatetime", "lastupdateby")148 list_display = ("id", "filepath", "render", "description", "lastupdatetime", "lastupdateby") 137 149 list_display_links = ("filepath", "description") 138 150 list_filter = ("site","render") … … 143 155 144 156 class UserProfileAdmin(VersionAdmin): 145 list_display = (" user", "site_info", "lastupdatetime", "lastupdateby")157 list_display = ("id", "user", "site_info", "lastupdatetime", "lastupdateby") 146 158 list_display_links = ("user",) 147 159 list_filter = ("site",)