Changeset 2072

Show
Ignore:
Timestamp:
07/03/09 13:33:20 (9 months ago)
Author:
JensDiemer
Message:

* Create the new model PyLucidAdminPage? (and share some code with PageTree? via base model)
* add admin.ModelAdmin? for django auth Permission

Location:
branches/0.9/pylucid_project
Files:
5 added
1 removed
12 modified
1 moved

Legend:

Unmodified
Added
Removed
  • branches/0.9/pylucid_project/apps/pylucid/admin.py

    r2059 r2072  
    1919from django.contrib import admin 
    2020from django.conf import settings 
    21 from django.contrib.auth.models import User 
     21from django.contrib.auth.models import User, Permission 
    2222from django.contrib.auth.admin import UserAdmin 
    2323 
     
    4646 
    4747UserAdmin.add_view = ugly_patched_add_view 
    48      
     48 
    4949 
    5050#------------------------------------------------------------------------------ 
     51 
     52class PermissionAdmin(admin.ModelAdmin): 
     53    """ django auth Permission """ 
     54    list_display = ("id", "name", "content_type", "codename") 
     55    list_display_links = ("name", "codename") 
     56    list_filter = ("content_type",) 
     57admin.site.register(Permission, PermissionAdmin) 
     58 
     59#------------------------------------------------------------------------------ 
     60 
     61class PyLucidAdminPageAdmin(VersionAdmin): 
     62    list_display = ( 
     63        "id", "get_absolute_url", "slug", "name", "title", "plugin_name", "view_name", 
     64    ) 
     65    list_display_links = ("slug", "get_absolute_url") 
     66    list_filter = ("createby", "lastupdateby",) 
     67    date_hierarchy = 'lastupdatetime' 
     68    search_fields = ("slug", "name", "title") 
     69 
     70admin.site.register(models.PyLucidAdminPage, PyLucidAdminPageAdmin) 
    5171 
    5272 
     
    5979    ) 
    6080    list_display_links = ("slug", "get_absolute_url") 
    61     list_filter = ("site", "type", "design", "createby", "lastupdateby", ) 
     81    list_filter = ("site", "type", "design", "createby", "lastupdateby",) 
    6282    date_hierarchy = 'lastupdatetime' 
    6383    search_fields = ("slug", "description") 
     
    7898    date_hierarchy = 'lastupdatetime' 
    7999    search_fields = ("description", "keywords") 
    80      
     100 
    81101 
    82102admin.site.register(models.PageMeta, PageMetaAdmin) 
     
    116136    model = models.Color 
    117137 
    118 class ColorSchemeAdmin(VersionAdmin):     
     138class ColorSchemeAdmin(VersionAdmin): 
    119139    list_display = ("id", "name", "preview", "lastupdatetime", "lastupdateby") 
    120140    list_display_links = ("name",) 
    121141    search_fields = ("name",) 
    122     inlines = [ColorInline,] 
    123      
     142    inlines = [ColorInline, ] 
     143 
    124144    def preview(self, obj): 
    125145        colors = models.Color.objects.all().filter(colorscheme=obj) 
     
    132152    preview.short_description = 'color preview' 
    133153    preview.allow_tags = True 
    134      
     154 
    135155admin.site.register(models.ColorScheme, ColorSchemeAdmin) 
    136156 
    137157 
    138 class DesignAdmin(VersionAdmin):     
     158class DesignAdmin(VersionAdmin): 
    139159    list_display = ("id", "name", "template", "colorscheme", "lastupdatetime", "lastupdateby") 
    140160    list_display_links = ("name",) 
     
    148168    list_display = ("id", "filepath", "render", "description", "lastupdatetime", "lastupdateby") 
    149169    list_display_links = ("filepath", "description") 
    150     list_filter = ("site","render") 
     170    list_filter = ("site", "render") 
    151171 
    152172admin.site.register(models.EditableHtmlHeadFile, EditableHtmlHeadFileAdmin) 
  • branches/0.9/pylucid_project/apps/pylucid/models.py

    r2071 r2072  
    4747from pylucid.fields import ColorValueField 
    4848from pylucid.system import headfile 
     49 
     50 
     51 
     52class TreeBaseModel(models.Model): 
     53    """ Base tree model used in PyLucidAdminPage and PageTree """ 
     54    parent = models.ForeignKey("self", null=True, blank=True, help_text="the higher-ranking father page") 
     55    position = models.SmallIntegerField(default=0, 
     56        help_text="ordering weight for sorting the pages in the menu.") 
     57    slug = models.SlugField(unique=False, help_text="(for building URLs)") 
     58 
     59    def get_absolute_url(self): 
     60        """ absolute url *without* language code (without domain/host part) """ 
     61        if self.parent: 
     62            parent_shortcut = self.parent.get_absolute_url() 
     63            return parent_shortcut + self.slug + "/" 
     64        else: 
     65            return "/" + self.slug + "/" 
     66 
     67    def __unicode__(self): 
     68        return u"%r tree object (%r)" % (self.slug, self.get_absolute_url()) 
     69 
     70    class Meta: 
     71        abstract = True 
     72        unique_together = (("slug", "parent"),) 
     73 
     74        # FIXME: It would be great if we can order by get_absolute_url() 
     75        ordering = ("id", "position") 
     76 
     77 
     78 
     79class PyLucidAdminPage(TreeBaseModel, UpdateInfoBaseModel): 
     80    """ 
     81    PyLucid Admin page tree 
     82     
     83    inherited attributes from TreeBaseModel: 
     84        parent 
     85        position 
     86        slug 
     87 
     88    inherited attributes from UpdateInfoBaseModel: 
     89        createtime     -> datetime of creation 
     90        lastupdatetime -> datetime of the last change 
     91        createby       -> ForeignKey to user who creaded this entry 
     92        lastupdateby   -> ForeignKey to user who has edited this entry 
     93    """ 
     94    name = models.CharField(blank=True, max_length=150, 
     95        help_text="Sort page name (for link text in e.g. menu)" 
     96    ) 
     97    title = models.CharField(blank=True, max_length=256, 
     98        help_text="A long page title (for e.g. page title or link title text)" 
     99    ) 
     100    plugin_name = models.CharField(max_length=150, help_text="Name of the plugin") 
     101    view_name = models.CharField(max_length=150, help_text="The view name") 
     102 
     103 
     104 
     105 
    49106 
    50107 
     
    156213 
    157214 
    158 class PageTree(UpdateInfoBaseModel): 
     215class PageTree(TreeBaseModel, UpdateInfoBaseModel): 
    159216    """ 
    160217    The CMS page tree 
     218 
     219    inherited attributes from TreeBaseModel: 
     220        parent 
     221        position 
     222        slug 
    161223 
    162224    inherited attributes from UpdateInfoBaseModel: 
     
    182244    on_site = CurrentSiteManager() 
    183245 
    184     parent = models.ForeignKey("self", null=True, blank=True, help_text="the higher-ranking father page") 
    185     position = models.SmallIntegerField(default=0, 
    186         help_text="ordering weight for sorting the pages in the menu.") 
    187     slug = models.SlugField(unique=False, help_text="(for building URLs)") 
     246 
    188247    description = models.CharField(blank=True, max_length=150, help_text="For internal use") 
    189248 
  • branches/0.9/pylucid_project/apps/pylucid/preference_forms.py

    r1950 r2072  
    11# coding: utf-8 
     2 
     3import warnings 
    24 
    35from django import forms 
     
    57from dbpreferences.forms import DBPreferencesBaseForm 
    68 
    7 from pylucid.models import Language 
     9from pylucid.models import PageTree, Design, Language 
    810 
    911if Language.objects.count() == 0: 
    1012    # FIXME: Insert first language 
    1113    Language(code="en", description="english").save() 
     14    warnings.warn("First language 'en' created.") 
    1215 
    1316 
    1417class SystemPreferencesForm(DBPreferencesBaseForm): 
    1518    """ test preferences form """ 
     19    pylucid_admin_design = forms.ChoiceField( 
     20        choices=Design.objects.values_list('id', 'name'), 
     21        required=False, initial=None, 
     22        help_text="ID of the PyLucid Admin Design.") 
     23 
    1624    lang_code = forms.ChoiceField( 
    1725        choices=Language.objects.values_list('code', 'description'), 
  • branches/0.9/pylucid_project/apps/pylucid/system/pylucid_plugin.py

    r2028 r2072  
    1616""" 
    1717 
    18 __version__= "$Rev:$" 
     18__version__ = "$Rev:$" 
    1919 
    2020import re 
    2121import sys 
     22import warnings 
    2223 
    2324from django import http 
     
    3637    """ 
    3738    """ 
     39    warnings.warn("TODO: Move into utils.pylucid_plugins!") 
     40 
    3841    # callback is either a string like 'foo.views.news.stories.story_detail' 
    3942    callback = "pylucid_plugins.%s.views.%s" % (plugin_name, method_name) 
     
    4245    except (ImportError, AttributeError), err: 
    4346        raise GetCallableError(err) 
    44      
     47 
    4548    # Add info for pylucid_project.apps.pylucid.context_processors.pylucid 
    4649    request.plugin_name = plugin_name 
    4750    request.method_name = method_name 
    48      
     51 
    4952    # call the plugin view method 
    5053    response = callable(request, **method_kwargs) 
    51      
     54 
    5255    return response 
    5356 
     
    7477            evalue = etype('Error rendering plugin view "%s.%s": %s' % (plugin_name, method_name, evalue)) 
    7578            raise etype, evalue, etb 
    76          
     79 
    7780        return response 
    7881 
     
    9295    """ Call a plugin and return the response. """ 
    9396    lang_entry = request.PYLUCID.lang_entry 
    94      
     97 
    9598    # Get the information witch django app would be used 
    9699    pluginpage = PluginPage.objects.get(page=request.PYLUCID.pagetree, lang=lang_entry) 
    97100    app_label = pluginpage.app_label 
    98101    plugin_urlconf_name = app_label + ".urls" 
    99      
     102 
    100103    # Get the urlpatterns from the plugin urls.py 
    101104    plugin_urlpatterns = import_module(plugin_urlconf_name).urlpatterns 
    102      
     105 
    103106    # build the url prefix 
    104107    prefix = "^%s/%s" % (lang_entry.code, prefix_url) 
     
    109112    urlpatterns2 = patterns('', url(prefix, [plugin_urlpatterns])) 
    110113    #print urlpatterns2 
    111      
     114 
    112115    # Append projects own url patterns, so the plugin can reverse url from them, too. 
    113116    current_urlpatterns = import_module(settings.ROOT_URLCONF).urlpatterns 
    114117    urlpatterns2 += current_urlpatterns 
    115      
     118 
    116119    # Make a own url resolver 
    117120    resolver = urlresolvers.RegexURLResolver(r'^/', urlpatterns2) 
    118      
     121 
    119122    #for key in resolver.reverse_dict: 
    120123    #    print key, resolver.reverse_dict[key] 
     
    125128    if result == None: 
    126129        _raise_resolve_error(prefix, plugin_urlpatterns, rest_url) 
    127      
     130 
    128131    view_func, view_args, view_kwargs = result 
    129132 
     
    132135        # FIXME: How can we better check, if the view is from the plugin and not from PyLucid??? 
    133136        _raise_resolve_error(prefix, plugin_urlpatterns, rest_url) 
    134      
     137 
    135138    # Patch urlresolvers.get_resolver() function, so only our own resolver with urlpatterns2 
    136139    # is active in the plugin. So the plugin can build urls with normal django function and 
     
    138141    old_get_resolver = urlresolvers.get_resolver 
    139142    urlresolvers.get_resolver = PluginGetResolver(resolver) 
    140      
     143 
    141144    #FIXME: Some plugins needs a "current pagecontent" object! 
    142145    #request.PYLUCID.pagecontent =  
    143      
     146 
    144147    # Call the view 
    145148    response = view_func(request, *view_args, **view_kwargs) 
    146      
     149 
    147150    # restore the patched function 
    148151    urlresolvers.get_resolver = old_get_resolver 
    149      
     152 
    150153    return response 
    151154 
     
    162165def _get_middleware_class(plugin_name): 
    163166    plugin_name = plugin_name.encode('ascii') # check non-ASCII strings 
    164      
     167 
    165168    mod_name = "pylucid_plugins.%s.context_middleware" % plugin_name 
    166169    module = import_module(mod_name) 
     
    176179    context = request.PYLUCID.context 
    177180    page_template = request.PYLUCID.page_template 
    178      
     181 
    179182    context["context_middlewares"] = {} 
    180      
     183 
    181184    plugin_names = TAG_RE.findall(page_template) 
    182185    for plugin_name in plugin_names: 
     
    187190            request.page_msg.error("Can't import context middleware '%s': %s" % (plugin_name, err)) 
    188191            continue 
    189          
     192 
    190193        # make a instance  
    191194        instance = middleware_class(request, context) 
     
    205208        except KeyError, err: 
    206209            return "[Error: context middleware %r doesn't exist!]" % plugin_name 
    207          
     210 
    208211        response = middleware_class_instance.render() 
    209212        if response == None: 
     
    220223                " http.HttpResponse instance or a basestring or None!" 
    221224            ) 
    222      
     225 
    223226    # FIXME: A HttpResponse allways convert unicode into string. So we need to do that here: 
    224227    # Or we say, context render should not return a HttpResponse? 
    225228#    from django.utils.encoding import smart_str 
    226229#    complete_page = smart_str(complete_page) 
    227      
     230 
    228231    source_content = response.content 
    229      
     232 
    230233    new_content = TAG_RE.sub(replace, source_content) 
    231234    response.content = new_content 
    232235    return response 
    233236 
    234          
  • branches/0.9/pylucid_project/apps/pylucid/templates/admin/base_site.html

    r2070 r2072  
    9595        <ul> 
    9696                    <li> 
     97                        <a>{% trans 'PyLucid install' %}</a> 
     98                        <ul> 
     99                            <li> 
     100                                <a href="{% url PyLucidAdmin-install_pylucid %}">{% trans 'PyLucid install' %}</a> 
     101                            </li> 
     102                            <li> 
     103                                <a href="{% url PyLucidAdmin-install_plugins %}">{% trans 'install PyLucid plugins' %}</a> 
     104                            </li> 
     105                        </ul> 
     106                    </li> 
     107                    <li> 
    97108                        <a href="{% url PyLucidUpdate-menu %}">{% trans 'update section' %}</a> 
    98109                    </li> 
  • branches/0.9/pylucid_project/apps/pylucid_admin/urls.py

    r2070 r2072  
    2020 
    2121urlpatterns = patterns('', 
    22     url(r'^menu$', views.menu, name='PyLucidAdmin-menu'), 
     22    url(r'^menu/$', views.menu, name='PyLucidAdmin-menu'), 
     23 
     24    url(r'^install/pylucid/$', views.install_pylucid, name='PyLucidAdmin-install_pylucid'), 
     25    url(r'^install/plugins/$', views.install_plugins, name='PyLucidAdmin-install_plugins'), 
    2326) 
  • branches/0.9/pylucid_project/apps/pylucid_admin/views.py

    r2070 r2072  
    11# coding: utf-8 
     2 
     3import os 
    24 
    35from django.conf import settings 
    46from django.template import RequestContext 
    57from django.core.urlresolvers import reverse 
     8from django.contrib.sites.models import Site 
    69from django.shortcuts import render_to_response 
     10from django.utils.translation import ugettext_lazy as _ 
     11from django.contrib.auth.models import User, Group 
     12 
     13from pylucid.models import PageTree, PageMeta, PageContent, PluginPage, Design 
     14from pylucid.preference_forms import SystemPreferencesForm 
     15from pylucid.system import pylucid_plugin, pylucid_objects 
     16 
     17from pylucid_project.utils import pylucid_plugins 
     18 
    719 
    820 
     
    1426        context_instance=RequestContext(request) 
    1527    ) 
     28 
     29 
     30 
     31def install_pylucid(request): 
     32    output = [] 
     33    output.append("*** PyLucid install:") 
     34 
     35    sys_pref_form = SystemPreferencesForm() 
     36 
     37    # ------------------------------------------------------------------------ 
     38    pylucid_admin_group, created = Group.objects.get_or_create(name=settings.ADMIN.USER_GROUP) 
     39    if created: 
     40        output.append("User group '%s' created." % settings.ADMIN.USER_GROUP) 
     41    else: 
     42        output.append("User group '%s' exist." % settings.ADMIN.USER_GROUP) 
     43 
     44    # ------------------------------------------------------------------------ 
     45    pylucid_admin_design, created = Design.objects.get_or_create( 
     46        name=settings.ADMIN.DESIGN_NAME, defaults={"template": "pylucid_admin/menu.html"} 
     47    ) 
     48    # TODO: Add to all sites? 
     49    #design.site.add(site) 
     50    if created: 
     51        output.append("Design '%s' created." % settings.ADMIN.DESIGN_NAME) 
     52    else: 
     53        output.append("Design '%s' exist." % settings.ADMIN.DESIGN_NAME) 
     54 
     55    # Add the Design id into the preferences 
     56    sys_pref_form["pylucid_admin_design"] = pylucid_admin_design.id 
     57# 
     58#    # ------------------------------------------------------------------------     
     59#    pylucid_admin_pagetree, created = PageTree.objects.get_or_create( 
     60#        slug="PyLucidAdmin", parent=None, site=Site.objects.get_current(), 
     61#        defaults={ 
     62#            "design": pylucid_admin_design, 
     63#            "type": PageTree.PAGE_TYPE, 
     64#        } 
     65#    ) 
     66#    pylucid_admin_pagetree.permitViewGroup = pylucid_admin_group 
     67# 
     68#    url = pylucid_admin_pagetree.get_absolute_url() 
     69#    if created: 
     70#        #tree_entry.save() 
     71#        output.append("PageTree '%s' created." % url) 
     72#    else: 
     73#        output.append("PageTree '%s' exist." % url) 
     74# 
     75#    # Add the PageTree id into the preferences 
     76#    sys_pref_form["pylucid_admin_pagetree"] = pylucid_admin_pagetree.id 
     77# 
     78#    # ------------------------------------------------------------------------ 
     79#    pylucid_admin_pagemeta, created = PageMeta.objects.get_or_create( 
     80#        page=pylucid_admin_pagetree, 
     81#        lang=request.PYLUCID.lang_entry, # FIXME: Create in all existing languages? 
     82#        defaults={"name": "PyLucid Admin", "robots":"noindex,nofollow"} 
     83#    ) 
     84#    if created: 
     85#        output.append("PageMeta %r created." % pylucid_admin_pagemeta) 
     86#    else: 
     87#        output.append("PageMeta %r exist." % pylucid_admin_pagemeta) 
     88# 
     89#    # ------------------------------------------------------------------------ 
     90#    pylucid_admin_pagecontent, created = PageContent.objects.get_or_create( 
     91#        page=pylucid_admin_pagetree, 
     92#        lang=request.PYLUCID.lang_entry, # FIXME: Create in all existing languages? 
     93#        pagemeta=pylucid_admin_pagemeta, 
     94#        defaults={ 
     95#            "content":"PyLucid Admin section. Please seletect a menu item.", 
     96#            "markup": PageContent.MARKUP_CREOLE, 
     97#        } 
     98#    ) 
     99#    if created: 
     100#        output.append("PageContent %r created." % pylucid_admin_pagecontent) 
     101#    else: 
     102#        output.append("PageContent %r exist." % pylucid_admin_pagecontent) 
     103 
     104    # Save new preferences 
     105    sys_pref_form.save() 
     106    output.append("System preferences saved.") 
     107 
     108    context = { 
     109        "title": "PyLucid - install", 
     110        "output": output, 
     111    } 
     112    return render_to_response('pylucid_admin/install.html', context, 
     113        context_instance=RequestContext(request) 
     114    ) 
     115 
     116 
     117def install_plugins(request): 
     118    """ Simple call all plugin install view, if exist. """ 
     119    output = [] 
     120 
     121    output.append("*** Install Plugins:") 
     122 
     123    for plugin_name, plugin_instance in pylucid_plugins.PLUGINS.iteritems(): 
     124        try: 
     125            response = plugin_instance.call_plugin_view( 
     126                request, settings.ADMIN.VIEW_FILENAME, settings.ADMIN.PLUGIN_INSTALL_VIEW_NAME, method_kwargs={} 
     127            ) 
     128        except plugin_instance.GetCallableError, err: 
     129            if settings.DEBUG: 
     130                output.append("Skip plugin %r, because it has no install view (%s)" % (plugin_name, err)) 
     131        else: 
     132            output.append("_" * 79) 
     133            output.append(" *** install plugin %r ***" % plugin_name) 
     134            assert isinstance(response, basestring) == True, "Plugin install view must return a basestring!" 
     135            output.append(response) 
     136 
     137        output.append("") 
     138 
     139    context = { 
     140        "title": "PyLucid - Plugin install", 
     141        "output": output, 
     142    } 
     143    return render_to_response('pylucid_admin/install.html', context, 
     144        context_instance=RequestContext(request) 
     145    ) 
  • branches/0.9/pylucid_project/pylucid_plugins/extrahead/__init__.py

    r1926 r2072  
     1 
  • branches/0.9/pylucid_project/pylucid_plugins/page_admin/admin_views.py

    r2070 r2072  
     1 
     2from django.utils.translation import ugettext_lazy as _ 
     3from django.contrib.auth.models import User, Group 
     4 
     5from pylucid.models import PyLucidAdminPage, Design 
     6from pylucid.preference_forms import SystemPreferencesForm 
     7from django.contrib.sites.models import Site 
     8 
     9ADMIN_SECTIONS = { 
     10    "create content": "Create new content." 
     11} 
    112 
    213 
    3 def test1(request): 
    4     return "Test view 1 content!" 
     14class AdminMenu(object): 
     15    def __init__(self, request, output): 
     16        self.request = request 
     17        self.output = output 
    518 
    6 def test2(request): 
    7     return "Test view 2 content!" 
     19        sys_preferences = SystemPreferencesForm().get_preferences() 
     20        admin_design_id = sys_preferences["pylucid_admin_design"] 
     21        self.admin_design = Design.objects.get(id=admin_design_id) 
     22 
     23    def add_menu_entry(self, **kwargs): 
     24        if "slug" not in kwargs: 
     25            kwargs["slug"] = kwargs["name"].replace(" ", "_") 
     26 
     27        adminpage_entry, created = PyLucidAdminPage.objects.get_or_create(**kwargs) 
     28        if created: 
     29            self.output.append("PyLucidAdminPage %r created." % adminpage_entry) 
     30        else: 
     31            self.output.append("PyLucidAdminPage %r exist." % adminpage_entry) 
     32 
     33        return adminpage_entry 
     34 
     35 
     36    def get_or_create_section(self, section_name): 
     37        title = ADMIN_SECTIONS[section_name] 
     38        adminpage_entry = self.add_menu_entry(name=section_name, title=title, parent=None) 
     39        return adminpage_entry 
     40 
     41 
     42def install(request): 
     43    """ insert PyLucid admin views into PageTree """ 
     44    output = [] 
     45 
     46    admin_menu = AdminMenu(request, output) 
     47    menu_section_entry = admin_menu.get_or_create_section("create content") 
     48 
     49    admin_menu.add_menu_entry( 
     50        parent=menu_section_entry, 
     51        name="new content page", title="Create a new content page.", 
     52        plugin_name=request.plugin_name, 
     53        view_name="new_content_page", 
     54    ) 
     55    admin_menu.add_menu_entry( 
     56        parent=menu_section_entry, 
     57        name="new plugin page", title="Create a new plugin page.", 
     58        plugin_name=request.plugin_name, 
     59        view_name="new_plugin_page", 
     60    ) 
     61 
     62    return "\n".join(output) 
     63 
     64 
     65def new_content_page(request): 
     66    return """ Create a new page """ 
     67 
     68def new_plugin_page(request): 
     69    return """ Create a new plugin page """ 
     70 
  • branches/0.9/pylucid_project/pylucid_plugins/redirect/urls.py

    r1965 r2072  
    66 
    77urlpatterns = patterns('', 
    8     url(r'^$', views.redirect ,name='PluginRedirect-redirect'), 
     8    url(r'^$', views.redirect, name='PluginRedirect-redirect'), 
    99) 
     10 
     11 
  • branches/0.9/pylucid_project/pylucid_plugins/__init__.py

    r2070 r2072  
    1 """ 
    2 Here should be stored all PyLucid plugins. 
    3 These plugins are normal django apps. 
    4 """ 
    51 
    6 import os 
    72 
    8 class PluginList(object): 
    9     """ 
    10     needed in settings.py 
    11     """ 
    12     _CACHE = None 
    13  
    14     def __init__(self, fs_path, pkg_prefix): 
    15         installed_apps = () 
    16         template_dirs = () 
    17         for dir_item in os.listdir(fs_path): 
    18             if dir_item.startswith("."): 
    19                 continue 
    20             item_path = os.path.join(fs_path, dir_item) 
    21             if not os.path.isdir(item_path): 
    22                 continue 
    23  
    24             pkg_string = ".".join([pkg_prefix, dir_item]) 
    25             installed_apps += (pkg_string,) 
    26  
    27             template_path = os.path.join(item_path, "templates") 
    28             if os.path.isdir(template_path): 
    29                 template_dirs += (template_path,) 
    30  
    31 #            admin_url_file = os.path.join(item_path, "admin_url.py") 
    32 #            if os.path.isfile(admin_url_file): 
    33 #                admin_urls.append(pkg_string + ".admin_url") 
    34  
    35         self._CACHE = { 
    36             "installed_apps": installed_apps, 
    37             "template_dirs": template_dirs, 
    38         } 
    39  
    40     def get_installed_apps(self): 
    41         return self._CACHE["installed_apps"] 
    42     def get_template_dirs(self): 
    43         return self._CACHE["template_dirs"] 
     3# 
  • branches/0.9/pylucid_project/settings.py

    r2071 r2072  
    174174# PyLucid own settings 
    175175 
    176 #from pylucid_project.apps.pylucid.app_settings import PYLUCID 
     176# Add app settings 
    177177from pylucid_project.apps.pylucid import app_settings as PYLUCID 
     178from pylucid_project.apps.pylucid_admin import app_settings as ADMIN 
     179 
    178180 
    179181# http://www.djangoproject.com/documentation/authentication/#other-authentication-sources 
  • branches/0.9/pylucid_project/tests/test_Design.py

    r2068 r2072  
    9090        ) 
    9191 
     92#    def test_colorscheme(self): 
     93 
     94 
    9295 
    9396