Re: Django Template Compilation rev.2

2011-03-30 Thread akaariai
re. On my computer the time went to around 25ms. For datetimes the time needed is somewhere around 100ms. If you could inline the localize(i) call for the integer case you would get back to around 4ms, as it doesn't actually do anything else than return force_unicode(i)... So, when designing templ

Re: Django Template Compilation rev.2

2011-03-30 Thread Jonathan Slenders
> Alex Gaynor wrote: > >     ... The >     semantics of Python code is that variables assigned in a for loop >     exist beyond the loop itself, including the looping variable. Django >     templates, however, pop the top layer from the context stack at the >     end of a for loop. This intermedia

[GSoC] Django Template Compilation rev.2

2011-03-30 Thread xtrqt
Django Template Compilation rev.2 = About Me I'm student of last year of Technical University of Lodz, Poland on faculty of electronic engineering and computer science, while now in parallel I'm doing my second diplom of electronic engineering o

Re: Template Compilation

2011-03-29 Thread Jonathan S
Maybe. We solved that use-case by adding another custom directory to TEMPLATE_DIRS when we had to override the base template. But I can imagine that someone wants to be able to dynamically change the base template, from inside a view or context processor. This was a choice we made, because almost

Re: Template Compilation

2011-03-28 Thread Jacob Kaplan-Moss
On Mon, Mar 28, 2011 at 11:04 AM, Dan Fairs wrote: > We don't have a core site base template. Each client on our system gets > their own, as IA/branding etc. varies considerably (and indeed includes > chunks of markup that the client supplies directly). ... and congratulations, you've successfull

Re: Template Compilation

2011-03-28 Thread Dan Fairs
- preprocess inheritance. (one important incompatibility: {% extend "..." %} should only get a string as parameter, not a variable! But honestly, I really don't know why someone would do that. For the record - we do! We don't have a core site base template. Each client on our system gets their

Re: Template Compilation

2011-03-28 Thread Jonathan S
Hi all, I have also been working for about a year on such a template compiler, and recently published it on Github. You may be interested in this project: https://github.com/citylive/django-template-preprocessor ** Short summary of what already is possible, and what still needs to be done: The

Re: Template Compilation

2011-03-28 Thread akaariai
On Mar 27, 5:48 am, "G.Boutsioukis" wrote: > Hi, I'm thinking about submitting a proposal for template compilation > and I'm posting this as a request for more info. > > In particular, I remember this project being discussed last year and I > pretty much assume

Re: [GSoC] Template Compilation

2011-03-26 Thread Russell Keith-Magee
On Sun, Mar 27, 2011 at 10:48 AM, G.Boutsioukis wrote: > Hi, I'm thinking about submitting a proposal for template compilation > and I'm posting this as a request for more info. > > In particular, I remember this project being discussed last year and I > pretty much a

Re: [GSoC] Template Compilation

2011-03-26 Thread Karen Tracey
On Sat, Mar 26, 2011 at 10:48 PM, G.Boutsioukis wrote: > What was the > rationale behind the decision to reject it? Unless, of course, it was > made on his part. > It wasn't rejected, Alex withdrew the template compilation proposal in favor of a non-relational DB project, wh

[GSoC] Template Compilation

2011-03-26 Thread G.Boutsioukis
Hi, I'm thinking about submitting a proposal for template compilation and I'm posting this as a request for more info. In particular, I remember this project being discussed last year and I pretty much assumed that Alex Gaynor's proposal would have been accepted(I see he's lis

Re: Template Compilation

2010-03-05 Thread Alex Gaynor
On Fri, Mar 5, 2010 at 2:54 PM, Jonathan S wrote: > Just a few thoughts, this is my idea and I'm not an expert at > compilers, so forgive me if I'm somewhere wrong. > > (1) For me, personally, I think the scoping of variables should be > kept inside a block. > > {% with "x" as x %} > {% with "y" a

Re: Template Compilation

2010-03-05 Thread Jonathan S
Just a few thoughts, this is my idea and I'm not an expert at compilers, so forgive me if I'm somewhere wrong. (1) For me, personally, I think the scoping of variables should be kept inside a block. {% with "x" as x %} {% with "y" as x %} {% endwith %} {{ x }} - you would print "y", because

Re: Template Compilation

2010-03-04 Thread Alex Gaynor
On Thu, Mar 4, 2010 at 8:01 PM, SmileyChris wrote: > Would whitespace handling be identical to the current template system? > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To post to this group, send email to django-develop...@goog

Re: Template Compilation

2010-03-04 Thread SmileyChris
Would whitespace handling be identical to the current template system? -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to d

Re: [GSOC] Template Compilation

2010-03-04 Thread Alex Gaynor
On Thu, Mar 4, 2010 at 6:58 PM, Russell Keith-Magee wrote: > On Fri, Mar 5, 2010 at 12:26 AM, Alex Gaynor wrote: >> On Thu, Mar 4, 2010 at 3:41 AM, Russell Keith-Magee >> wrote: >>> On Thu, Mar 4, 2010 at 7:29 AM, Alex Gaynor wrote: > Templates will be compiled by turning each template int

Re: [GSOC] Template Compilation

2010-03-04 Thread Russell Keith-Magee
On Fri, Mar 5, 2010 at 12:26 AM, Alex Gaynor wrote: > On Thu, Mar 4, 2010 at 3:41 AM, Russell Keith-Magee > wrote: >> On Thu, Mar 4, 2010 at 7:29 AM, Alex Gaynor wrote: >>> Templates will be compiled by turning each template into a series of >>> functions, >>> one per block (note that the base

Re: [GSOC] Template Compilation

2010-03-04 Thread Alex Gaynor
On Thu, Mar 4, 2010 at 3:41 AM, Russell Keith-Magee wrote: > On Thu, Mar 4, 2010 at 7:29 AM, Alex Gaynor wrote: >> Django Template Compilation >> === > > First up, this looks like a solid proposal Alex. Anything that speeds > up template generat

Re: [GSOC] Template Compilation

2010-03-04 Thread Russell Keith-Magee
On Thu, Mar 4, 2010 at 7:29 AM, Alex Gaynor wrote: > Django Template Compilation > === First up, this looks like a solid proposal Alex. Anything that speeds up template generation is good, and if your indicative stats turn out to be representative of real

[GSOC] Template Compilation

2010-03-03 Thread Alex Gaynor
Django Template Compilation === About Me I'm a sophomore computer science student at Rensselaer Polytechnic Institute. I'm a frequent contributor to Django (including last year's successful multiple database GSoC project) and other related proje