Re: Self-referenced template recursion handling

2013-12-29 Thread unai
Hi there! > In fact, it allows arbitrary nesting and combinations. It works by > keeping a list of possible sources for each template and as template > is rendered it removes it from the list, so that next time it is not > loaded anymore. I'm not entirely convinced about maintaining a dicts of

Re: Self-referenced template recursion handling

2013-12-29 Thread Mitar
Hi! I just discovered this thread on the mailing list. I implemented also template recursion in this modified django-overextends: https://github.com/wlanslovenija/django-overextends/blob/nested-extends/overextends/templatetags/overextends_tags.py It supports all possible combinations. For

Re: Self-referenced template recursion handling

2013-12-11 Thread unai
Hi there! > I'm working on an other solution that instead of relying on loader > skipping relies on template skipping. Sorry for keeping you waiting on updates for so long! I was able to put some time into it today. Although it isn't nothing definitive and testing, benchmarking and docs are

Re: Self-referenced template recursion handling

2013-12-11 Thread unai
Hi there! > Florian, I know that the benefits of this solution. But I see the > detriments too. I think that if we allow that a app template > overwrite with self-reference another app template the template > development will be a chaos. I thought alot about it Well, I agree that if miss used,

Re: Self-referenced template recursion handling

2013-12-09 Thread J . Pablo Martín Cobos
Florian, I know that the benefits of this solution. But I see the detriments too. I think that if we allow that a app template overwrite with self-reference another app template the template development will be a chaos. I thought alot about it 2013/12/9 Florian Apolloner

Re: Self-referenced template recursion handling

2013-12-09 Thread Florian Apolloner
Just as a good example on why it's not a good idea to skip a loader: Grappelli could most likely strongly benefit from this feature and their preferred setup looks like this http://django-grappelli.readthedocs.org/en/latest/quickstart.html#setup -- Having to set TEMPLATE_DIRS to the grappelli

Re: Self-referenced template recursion handling

2013-12-09 Thread Florian Apolloner
On Monday, December 9, 2013 5:18:16 PM UTC+1, Goinnn wrote: > > 2013/12/9 Florian Apolloner > >> On Monday, December 9, 2013 12:43:04 PM UTC+1, Goinnn wrote: >>> >>> 1. Efficiency: If this new solution slows the compilation/find/render >>> template, I dislike it >>> >> >>

Re: Self-referenced template recursion handling

2013-12-09 Thread J . Pablo Martín Cobos
2013/12/9 Florian Apolloner > On Monday, December 9, 2013 12:43:04 PM UTC+1, Goinnn wrote: >> >> 1. Efficiency: If this new solution slows the compilation/find/render >> template, I dislike it >> > > Lots of "ifs" which are not really worth discussing before we run actual

Re: Self-referenced template recursion handling

2013-12-09 Thread unai
> I read Pablo's concern as: If the skipping is done in each loader, > does "recursive" self-reference work across loaders? Uh, I didn't understand, of course you can ;-) Imagine you are extending an app template from within a project template and that the order of the loaders is [dirs, app].

Re: Self-referenced template recursion handling

2013-12-09 Thread Florian Apolloner
On Monday, December 9, 2013 12:43:04 PM UTC+1, Goinnn wrote: > > 1. Efficiency: If this new solution slows the compilation/find/render > template, I dislike it > Lots of "ifs" which are not really worth discussing before we run actual benchmarks; also I think that it won't be slower since

Re: Self-referenced template recursion handling

2013-12-09 Thread Shai Berger
On Monday 09 December 2013 14:58:34 unai wrote: > > > 2. This solution will complicate the template development. e.g. if a > > > > application overwrite the "admin/change_form.html" template and a > > developer wants to update this template, he will have to search this > > template in every

Re: Self-referenced template recursion handling

2013-12-09 Thread unai
Hi! > 1. Efficiency: If this new solution slows the compilation/find/render > template, I dislike it Well, if there is no self-referenced inheritance, no extra code (except for the very same self-referenced inheritance check) is executed, so there is that. If self-referenced inheritance is

Re: Self-referenced template recursion handling

2013-12-09 Thread J . Pablo Martín Cobos
2013/12/8 unai > Hello, > > > given this approach, what if the third party app wants to self-extend > > a django admin template for example? > > I'm working on an other solution that instead of relying on loader skipping > relies on template skipping. > > Imagine you

Re: Self-referenced template recursion handling

2013-12-08 Thread unai
Hello, > I tend to warn people off thinking of template names as paths. It's > an implementation detail that they are treated as such by the two > default loaders. > Requiring each loader to include an unique id with each template > (even if it's just a full path) seems the easiest solution. >

Re: Self-referenced template recursion handling

2013-12-08 Thread Curtis Maloney
unai wrote: >Hello, > >> given this approach, what if the third party app wants to self-extend >> a django admin template for example? > >I'm working on an other solution that instead of relying on loader >skipping >relies on template skipping. > >Imagine you extend to a

Re: Self-referenced template recursion handling

2013-12-08 Thread Alex Hill
Hi all, If anybody's interested in some background reading, there is an implementation of this in Mezzanine, using an "overextends" tag. https://github.com/stephenmcd/mezzanine/blob/1.4.16/mezzanine/template/loader_tags.py Cheers, Alex On Sunday, December 8, 2013 11:08:12 PM UTC+8, unai

Re: Self-referenced template recursion handling

2013-12-08 Thread unai
Hello, > given this approach, what if the third party app wants to self-extend > a django admin template for example? I'm working on an other solution that instead of relying on loader skipping relies on template skipping. Imagine you extend to a self-reference from within a template. All the

Re: Self-referenced template recursion handling

2013-12-08 Thread Pantelis Petridis
, unai wrote: Hi! Pablo Martín (goinnn[0]) and I have been working on self-referenced template recursion handling for the past few weeks. The idea is that when a template references itself when extending, recursion is avoided by skipping the current template loader (ticket #15053[1]). This new

Re: Self-referenced template recursion handling

2013-12-08 Thread J . Pablo Martín Cobos
2013/12/8 Jonathan Slenders > Do we ever intend to implement something like collect_templates in the > future? Similar to collect_static? > I think that for this reason exists the cache template loader, it is something similar. With this template loader every

Re: Self-referenced template recursion handling

2013-12-08 Thread J . Pablo Martín Cobos
2013/12/7 Florian Apolloner > Hi, > > there is no need to convince us that this feature would be nice to have; > the ticket is accepted… > Yes this ticket is accepted, but this is accepted from 3 years ago... I think that everybody knows that the current solution needs

Re: Self-referenced template recursion handling

2013-12-08 Thread Jonathan Slenders
Do we ever intend to implement something like collect_templates in the future? Similar to collect_static? If so, implementing this would break collect_templates or the similarity that we currently have in how app directories are processed. This is actually the monkey-patching way of writing

Re: Self-referenced template recursion handling

2013-12-07 Thread J . Pablo Martín Cobos
2013/12/6 German Larrain > On Friday, December 6, 2013 11:36:00 AM UTC-3, unai wrote: >> >> Lot of app/CMS creators create base templates for their apps. Currently, >> if one >> of those templates needs some kind of change, the user needs to copy the >> template all

Re: Self-referenced template recursion handling

2013-12-06 Thread German Larrain
On Friday, December 6, 2013 11:36:00 AM UTC-3, unai wrote: > > Lot of app/CMS creators create base templates for their apps. Currently, > if one > of those templates needs some kind of change, the user needs to copy the > template all over again, making it difficult to update their templates >

Self-referenced template recursion handling

2013-12-06 Thread unai
Hi! Pablo Martín (goinnn[0]) and I have been working on self-referenced template recursion handling for the past few weeks. The idea is that when a template references itself when extending, recursion is avoided by skipping the current template loader (ticket #15053[1]). This new feature would