Django CMS 3.11.10 Documentation): name = _("Polls Menu") # give the menu a name this is required. def get_nodes(self, request): """ This method is used to build the menu tree. """ nodes = [] enable this use the cms.middleware.language.LanguageCookieMiddleware to set the cookie on every request. How django CMS determines what language to serve Once it has identified a user’s language, it will apply_modifiers() menus.menu_pool.MenuPool._mark_selected() loops over each node, comparing its URL with the request.path_info, and marks the best match as selected loops over the Modifiers (see Menu Modifiers below)0 码力 | 493 页 | 1.44 MB | 6 月前0.03
django cms 4.1.1 Documentation
PollsMenu(CMSAttachMenu): name = _("Polls Menu") # give the menu a name this is required. def get_nodes(self, request): """ This method is used to build the menu tree. """ (continues on next page) 5.2. Django/Python enable this use the cms.middleware.language.LanguageCookieMiddleware to set the cookie on every request. How django CMS determines what language to serve Once it has identified a user’s language, it – menus.menu_pool.MenuPool._mark_selected() – loops over each node, comparing its URL with the request.path_info, and marks the best match as selected 5.2. Django/Python compatibility table 57 django0 码力 | 361 页 | 2.00 MB | 1 年前3
Django CMS 4.1.x Documentation): name = _("Polls Menu") # give the menu a name this is required. def get_nodes(self, request): """ This method is used to build the menu tree. """ nodes = [] enable this use the cms.middleware.language.LanguageCookieMiddleware to set the cookie on every request. How django CMS determines what language to serve Once it has identified a user’s language, it will apply_modifiers() menus.menu_pool.MenuPool._mark_selected() loops over each node, comparing its URL with the request.path_info, and marks the best match as selected loops over the Modifiers (see Menu Modifiers below)0 码力 | 518 页 | 1.66 MB | 6 月前3
django cms 4.1.x DocumentationPollsMenu(CMSAttachMenu): name = _("Polls Menu") # give the menu a name this is required. def get_nodes(self, request): """ This method is used to build the menu tree. """ (continues on next page) 5.2. Django/Python enable this use the cms.middleware.language.LanguageCookieMiddleware to set the cookie on every request. How django CMS determines what language to serve Once it has identified a user’s language, it – menus.menu_pool.MenuPool._mark_selected() – loops over each node, comparing its URL with the request.path_info, and marks the best match as selected 5.2. Django/Python compatibility table 57 django0 码力 | 357 页 | 1.99 MB | 1 年前3
django cms 3.10.x DocumentationPollsMenu(CMSAttachMenu): name = _("Polls Menu") # give the menu a name this is required. def get_nodes(self, request): """ This method is used to build the menu tree. """ (continues on next page) 4.1. Django/Python return the request object in the context. This is typically achieved in Django applications by using RequestContext: from django.shortcuts import get_object_or_404, render def my_model_detail(request, id): id): object = get_object_or_404(MyModel, id=id) return render(request, 'my_model_detail.html', { 'object': object, }) If you want to render plugins from a specific language, you can use the tag like this:0 码力 | 296 页 | 1.79 MB | 1 年前3
Django CMS 3.9.x Documentation): name = _("Polls Menu") # give the menu a name this is required. def get_nodes(self, request): """ This method is used to build the menu tree. """ nodes = [] (optional) The view in which you render your placeholder field must return the request [https://docs.djangoproject.com/en/2.2/ref/request-response/#django.http.HttpRequest] object in the context. This is typically shortcuts import get_object_or_404, render def my_model_detail(request, id): object = get_object_or_404(MyModel, id=id) return render(request, 'my_model_detail.html', { 'object': object,0 码力 | 417 页 | 1.68 MB | 6 月前3
Django CMS 3.9.x DocumentationPollsMenu(CMSAttachMenu): name = _("Polls Menu") # give the menu a name this is required. def get_nodes(self, request): """ This method is used to build the menu tree. """ nodes = [] for poll in Poll.objects.all(): return the request object in the context. This is typically achieved in Django applications by using RequestContext: from django.shortcuts import get_object_or_404, render def my_model_detail(request, id): id): object = get_object_or_404(MyModel, id=id) return render(request, 'my_model_detail.html', { 'object': object, }) If you want to render plugins from a specific language, you can use the tag like this:0 码力 | 298 页 | 1.79 MB | 6 月前3
django cms 3.3.x Documentation): name = _("Polls Menu") # give the menu a name this is required. def get_nodes(self, request): """ This method is used to build the menu tree. """ nodes = [] directory in a file called hello_plugin.html:Hello {% if request.user.is_authenticated %}{{ request.user.first_name }} {{ request.user.last_name}}{% else %}Guest{% endif %}
This plugin will template to make use of this new configuration:Hello {% if request.user.is_authenticated %} {{ request.user.first_name }} {{ request.user.last_name}} {% else %} {{ instance.guest_name }} {% endif
0 码力 | 386 页 | 1.56 MB | 1 年前3
django cms 3.5.x Documentation): name = _("Polls Menu") # give the menu a name this is required. def get_nodes(self, request): """ This method is used to build the menu tree. """ nodes = [] directory in a file called hello_plugin.html:Hello {% if request.user.is_authenticated %}{{ request.user.first_name }} {{ request.user.last_name}}{% else %}Guest{% endif %}
This plugin will template to make use of this new configuration:Hello {% if request.user.is_authenticated %} {{ request.user.first_name }} {{ request.user.last_name}} {% else %} {{ instance.guest_name }} {% endif
0 码力 | 403 页 | 1.69 MB | 1 年前3
django cms 3.7.x Documentation): name = _("Polls Menu") # give the menu a name this is required. def get_nodes(self, request): """ This method is used to build the menu tree. """ nodes = [] (optional) The view in which you render your placeholder field must return the request [https://docs.djangoproject.com/en/2.2/ref/request-response/#django.http.HttpRequest] object in the context. This is typically shortcuts import get_object_or_404, render def my_model_detail(request, id): object = get_object_or_404(MyModel, id=id) return render(request, 'my_model_detail.html', { 'object': object, })0 码力 | 409 页 | 1.67 MB | 1 年前3
共 91 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10













