Changeset 2027

Show
Ignore:
Timestamp:
06/12/09 12:31:20 (9 months ago)
Author:
JensDiemer
Message:

add pagemeta to pylucid objects

Location:
branches/0.9/pylucid_project
Files:
4 modified

Legend:

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

    r2008 r2027  
    55 
    66class PyLucidRequestObjects(object): 
    7     """ PyLucid request objects """ 
     7    """ 
     8    PyLucid request objects 
     9    see also: http://www.pylucid.org/_goto/187/PyLucid-objects/ 
     10    """ 
    811    def __init__(self): 
    912        self.system_preferences = SystemPreferencesForm().get_preferences() 
     
    1215        self.default_lang_entry = Language.objects.get(code=default_lang_code) 
    1316        # objects witch will be set later: 
    14         #self.pagetree - The current page tree instance 
     17        #self.pagetree - The current PageTree model instance 
     18        #self.pagemeta - The current PageMeta model instance 
    1519        #self.pagecontent - PageContent instance, but only if the current page is not a PagePlugin! 
    1620        #self.lang_entry - The current language instance 
  • branches/0.9/pylucid_project/apps/pylucid/views.py

    r2022 r2027  
    8080    """ render a cms page """    
    8181    request.PYLUCID.pagetree = pagetree 
     82 
     83    # Get the pagemeta instance for the current pagetree and language 
     84    pagemeta = PageTree.objects.get_pagemeta(request) 
     85    request.PYLUCID.pagemeta = pagemeta 
    8286     
    8387    # Get template content and add it to PyLucid objects 
     
    8589    page_template, origin = loader.find_template_source(template_name) 
    8690    request.PYLUCID.page_template = page_template 
    87      
    88     # Get the pagemeta instance for the current pagetree and language 
    89     pagemeta = PageTree.objects.get_pagemeta(request) 
    9091     
    9192    # Create initial context object 
  • branches/0.9/pylucid_project/tests/test_PluginAPI.py

    r2023 r2027  
    197197                            " (site: %s, type: PluginPage)>" 
    198198                        ) % site.name, 
     199                        ( 
     200                            "pagemeta: <PageMeta: PageMeta for page: '3-pluginpage'" 
     201                            " (lang: '%s')>" 
     202                        ) % language.code, 
    199203                        "system_preferences: {'lang_code': u'%s'}" % self.default_lang_code, 
    200204                    ), 
  • branches/0.9/pylucid_project/tests/unittest_plugin/views.py

    r2022 r2027  
    104104 
    105105def test_PyLucid_api(request): 
    106     """ Test the PyLucid API """ 
     106    """ 
     107    Test the PyLucid API 
     108    see also: http://www.pylucid.org/_goto/187/PyLucid-objects/ 
     109    """ 
    107110    request.page_msg(PLUGINPAGE_API_TEST_PAGE_MSG) 
    108111     
     
    115118    output.append("page_template: %r" % request.PYLUCID.page_template) 
    116119    output.append("pagetree: %r" % request.PYLUCID.pagetree) 
     120    output.append("pagemeta: %r" % request.PYLUCID.pagemeta) 
    117121    output.append("system_preferences: %r" % request.PYLUCID.system_preferences) 
    118122