Show
Ignore:
Timestamp:
05/23/08 16:33:49 (6 months ago)
Author:
JensDiemer
Message:

new page_msg system. Use a middleware to make page_msg lazy: ticket:193

  • update settings_example.py (insert new middleware)
  • change """contextpage_msg?""" to """request.page_msg"""
  • add a simple page_msg unittest (Need more tests!)
  • update _install data (Templates and index page)
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/PyLucid/models/Plugin.py

    r1584 r1585  
    2424from django.contrib.auth.models import User, Group 
    2525 
     26from PyLucid.system.plugin_import import get_plugin_config, get_plugin_version 
    2627from PyLucid.tools.newforms_utils import get_init_dict, setup_help_text 
    2728from PyLucid.tools.data_eval import data_eval, DataEvalError 
     
    106107        evaluate the pformat string into a dict and return it. 
    107108        """ 
    108         data_dict = data_eval(self.pref_data_string) 
     109        if self.pref_data_string == None: 
     110            # There exist no preferences (e.g. plugin update not applied, yet) 
     111            data_dict = None 
     112        else: 
     113            data_dict = data_eval(self.pref_data_string) 
    109114        preference_cache[self.plugin_name] = data_dict 
    110115        return data_dict