Changeset 2517
- Timestamp:
- 01/29/10 13:03:25 (7 weeks ago)
- Location:
- branches/0.9/pylucid_project/pylucid_plugins/page_admin
- Files:
-
- 2 modified
-
admin_views/tag_list.py (modified) (3 diffs)
-
templates/page_admin/tag_list_popup.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.9/pylucid_project/pylucid_plugins/page_admin/admin_views/tag_list.py
r2494 r2517 10 10 import inspect 11 11 12 from django.utils.translation import ugettext_lazy as _ 12 from django.template import RequestContext 13 from django.utils.translation import ugettext as _ 13 14 14 15 from pylucid_project.apps.pylucid.markup.django_tags import DjangoTagAssembler … … 17 18 18 19 from pylucid_project.system.pylucid_plugins import PYLUCID_PLUGINS 19 20 from pylucid_project.apps.pylucid.models import PageTree, PageMeta 20 21 from pylucid_project.utils.escape import escape 21 22 … … 81 82 lucid_tags.sort(cmp=lambda x, y: cmp(x["plugin_name"].lower(), y["plugin_name"].lower())) 82 83 84 85 # Add PageTree and PageMeta instance to request.PYLUCID for get 86 # context keys witch are related to these objects. 87 # see pylucid_project.apps.pylucid.context_processors 88 old_pylucid_obj = request.PYLUCID 89 90 pagetree = PageTree.objects.get_root_page(request.user) 91 pagemeta = PageTree.objects.get_pagemeta(request, pagetree, show_lang_errors=False) 92 request.PYLUCID.pagetree = pagetree 93 request.PYLUCID.pagemeta = pagemeta 94 95 request_context = RequestContext(request) 96 97 request.PYLUCID = old_pylucid_obj 98 99 # Collect all existing tags from all context dicts 100 request_context_dicts = request_context.dicts 101 context_keys = set() 102 for d in request_context_dicts: 103 print set(d.keys()) 104 context_keys.update(set(d.keys())) 105 106 context_keys = list(context_keys) 107 context_keys.sort(cmp=lambda x, y: cmp(x.lower(), y.lower())) 108 83 109 context = { 84 110 "title": "lucidTag list", 111 "context_keys": context_keys, 85 112 "lucid_tags": lucid_tags 86 113 } -
branches/0.9/pylucid_project/pylucid_plugins/page_admin/templates/page_admin/tag_list_popup.html
r2449 r2517 25 25 {% endfor %} 26 26 </table> 27 28 <h1>context keys</h1> 29 <p> 30 (Note: Not all of these tags are useable into page template or page content) 31 </p> 32 <ul> 33 {% for key in context_keys %} 34 <li>{{ {{ key }} }}</li> 35 {% endfor %} 36 </ul> 27 37 {% endblock content %}