Questions tagged [template-context]

5 questions
3
votes
0 answers

How to pass data from child template to parent template then to included template in Django?

Basically what i want to accomplish is be able to access some variable or content from a template after performing extend then include. No better way to explain what i want to do better than a sample code so, home.html {% with page="homepage" %} {%…
2
votes
1 answer

Records getting duplicated when mapped to object in TemplateContext.Database.SqlQuery function

I am getting strange issue when I am calling a stored procedure like this using TemplateContext string query = "exec SearchRequest @recct = @TotalCount OUTPUT" + parametersString.ToString(); var requestDtos = ctx.Database.SqlQuery(query,…
Pawan Nogariya
  • 8,330
  • 12
  • 52
  • 105
1
vote
1 answer

Acess context from request in Django

How can we access the context passed in template in method views? urls.py urlpatterns = [ path('', views.method_A, name='first_view'), path('method_B', views.method_B, name='second_view'), ] def method_A(request): context =…
1
vote
2 answers

How can I pass context data to sylesheet 'src' and image 'src' attributes?

I have a _layout.html template as follows: {% load staticfiles %} {% block linkcss %}{% endblock %} {% block title %}{% endblock %}