cache). With my proposal your
>>>>>>>>> view
>>>>>>>>>render only 1 template (This is not 100% true, 1 + templates about
>>>>>>>>>templatetags except extends and include)
>>>>>>>>
t;>>>> destination_name = template.origin.name
>>>>>>>>
>>>>>>>>
>>>>>>>> 8 years ago I requested a feature related with templates
>>>>>>>>
>>>>>>>
>>>>>>
/query?status=assigned=closed=new=~pmartin=id=summary=status=owner=type=component=version=1=id
>>>>>>> 3. https://gist.github.com/goinnn/8a42314fccdd13bcf4df256a277ec1f6
>>>>>>> (tested in Django 1.8 - 1.11)
>>>>>>> 4.
>>>>>>> https://gi
o/pulls?q=is%3Apr+author%3Agoinnn+is%3Aclosed
>>>>>>> 2.
>>>>>>> https://code.djangoproject.com/query?status=assigned=closed=new=~pmartin=id=summary=status=owner=type=component=version=1=id
>>>>>>> 3. https://gist.github.com/goinnn/8a423
ably releasing it with BSD license like Django itself is.
>>>>>> Otherwise there are very little chances that your solution would make to
>>>>>> django it self.
>>>>>>
>>>>>> Improvements to rendering are a
rom one year ago, I am using an own command for Django templates
>>>>>> that unify them. With an example it is easy to see. If I am to render for
>>>>>> example a template call news.html like it:
>>>>>>
>>>>>>
" %}
>>>>> {% endblock %}
>>>>>
>>>>> {% block content %}
>>>>> {% for news_item in news %}
>>>>> {{ news_item.title }}
>>>>> {{ news_item.subtitle }}
>>>&g
ault:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif
>>>> %}>
>>>>
>>>> {% block title %}{% endblock %}
>>>>
>>>>
>>>> {% block content
ommand I preproces every template of a settings variable and
>>> I get something like this:
>>>
>>> news.unify.html
>>>
>>> >> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
>>> http://www.w3.org/1999/xhtml; lang="{{
>>&
%}>
>>
>> News
>>
>>
>> {% for news_item in news %}
>> {{ news_item.title }}
>> {{ news_item.subtitle }}
>> {% endfor %}
>>
&
tle }}
> {{ news_item.subtitle }}
> {% endfor %}
>
>
>
> So I have a two improves:
>
>1. It is more fast. And in a real project a view can render easyly 50
>templates
>2. I use news.html to develop and news.unify.html to p
tle }}
> {{ news_item.subtitle }}
> {% endfor %}
>
>
>
> So I have a two improves:
>
> 1. It is more fast. And in a real project a view can render
> easyly 50 temp
ething like this:
>>>
>>> news.unify.html
>>>
>>> >> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
>>> http://www.w3.org/1999/xhtml; lang="{{
>>> LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %
> %}>
>>
>> News
>>
>>
>> {% for news_item in news %}
>> {{ news_item.title }}
>> {{ news_item.subtitle }}
>> {% endfor %}
>>
>>
>
>> News
>>
>>
>> {% for news_item in news %}
>> {{ news_item.title }}
>> {{ news_item.subtitle }}
>> {% endfor %}
>>
>>
>>
>&g
endfor %}
>
>
>
> So I have a two improves:
>
>1. It is more fast. And in a real project a view can render easyly 50
>templates
>2. I use news.html to develop and news.unify.html to production. So I
>don't lose legilibility.
>
>
> What do
{{ news_item.subtitle }}
> {% endfor %}
>
>
>
> So I have a two improves:
>
>1. It is more fast. And in a real project a view can render easyly 50
>templates
>2. I use news.html to develop and news.unify.html to production
And in a real project a view can render easyly 50
templates
2. I use news.html to develop and news.unify.html to production. So I
don't lose legilibility.
What do you think about "unify templates feature"? Do you know if exists a
similar public project in github/gitlab/bitbucket etc
18 matches
Mail list logo