Re: Template Engine Compilation and Runtime Refactoring Progress

2011-07-18 Thread Armin Ronacher
Hi, Current status: The freezing of free variables into a context dictionary for includes and extension is currently not working as expected. The reason is obvious but the solution is not entirely clear to me yet. I need to track what variables were assigned to until a specific statement, not on

Re: [GSOC] Template Engine Compilation and Runtime Refactoring Progress

2011-07-06 Thread Armin Ronacher
Hi, Status of this week: I spend the last week mostly trying to figure out how to debug a bunch of annoying issues and due to the slow progress I decided on doing an AST -> Python code translation for debugging purposes. The identifier tracking method I naively started using initially (which is

Re: Template Engine Compilation and Runtime Refactoring Progress

2011-06-27 Thread Armin Ronacher
Hi, Progress update. This week I was starting the work on the compiler and I have at least for Django's use case most compilation things ironed out. However it turns out that compiling AST nodes made from scratch is a painful process as the interpreter will randomly segfault or fail compiling wi

Re: Template Engine Compilation and Runtime Refactoring Progress

2011-06-18 Thread Armin Ronacher
Hi, On Jun 17, 2:18 pm, Anatoly Vostryakov wrote: >   I've thought today. May be it will possible to add support of > parameters for functions or object methods in django templates. > I mean, something like this in django template: The compiler is able to handle this case, but the syntax of the D

Re: Template Engine Compilation and Runtime Refactoring Progress

2011-06-16 Thread Armin Ronacher
Hi, I'm in between two conferences right now and university and a bunch of other stuff needs attention as well so progress is slowed down quite a bit right now. Will however catch up next week with what I cannot do this one. Regards, Armin -- You received this message because you are subscrib

Re: Template inheritance and duplicated content.

2011-06-09 Thread Armin Ronacher
Hi, On May 24, 10:58 am, Jonathan Slenders wrote: > I guess this is a flaw in the inheritance algorithm, only the most > outer blocks should be used during the resolving of inheritance. How else would it work? Think of a block like a function plus the execution of that function. By placing a ne

Re: Template Engine Compilation and Runtime Refactoring Progress

2011-06-05 Thread Armin Ronacher
Hi, Weekly progress report: I started on documenting some of the behavior that the current django template engine has and how it affects the compilation. The nodes are mostly implemented and some of them can be interpreted already. I want to finish the interpreter first because that way we can eas

Re: Template Engine Compilation and Runtime Refactoring Progress

2011-05-30 Thread Armin Ronacher
Hi, The progress went slower than expected because I had to analyze some more runtime differences between Django and Jinja2 which I missed at first. The main problem are changes in the safe-string behavior but I think I found a possible solution to counter that. I had to diverge from my previous p

Re: Template Engine Compilation and Runtime Refactoring Progress

2011-05-24 Thread Armin Ronacher
Hi, The repository with my changes will be here: https://github.com/mitsuhiko/django-template-compilation As this proposal implements a 'newtemplates' module in Django instead of modifying the existing one until it's proven to be compatible in every single regard, I will have it as a separate r

[GSOC] Template Engine Compilation and Runtime Refactoring Progress

2011-05-02 Thread Armin Ronacher
Hi, This is the first weekly status update of many to come. Just a quick overview of this project and myself. My nickname on freenode is 'mitsuhiko' and this is the preferred form to reach me in general. Alternatively my twitter account with the same name is a good way of reaching me even when I'

Re: Proposal for Template Engine Refactoring

2011-03-29 Thread Armin Ronacher
Hi, On Mar 29, 3:54 pm, Jacob Kaplan-Moss wrote: > Can you speak a little more about how you'd see the workflow working > with this new library? It seems a bit complex to have a library that's > *copied* between Django and Jinja: I'd worry about patches getting > lost. I think that problem can mo

Re: Proposal for Template Engine Refactoring

2011-03-29 Thread Armin Ronacher
Hi, On Mar 29, 2:23 pm, Jonathan S wrote: > Are you planning on keeping the API for registering template tags > compatible?  (django.template.Library.register.tag) It will be supported because otherwise upgrading won't be possible, but how well this works in detail would have to be investigated a

Re: Proposal for Template Engine Refactoring

2011-03-29 Thread Armin Ronacher
Great. Google groups decided to reflow my mail. Here in actually readable version: http://paste.pocoo.org/show/362024/ Regards, Armin -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@go

Proposal for Template Engine Refactoring

2011-03-29 Thread Armin Ronacher
Hi, I would like to participate in this year's Google Summer of Code by introducing a new backend for the Django (and Jinja2) templating language. As the author of Jinja2 I recently decided to rewrite the code generation of the engine to better support alternative Python implementations like PyPy

#10216 - TEMPLATE_DEBUG / TemplateSyntaxError handling doesn't play nice with Jinja2

2010-02-06 Thread Armin Ronacher
Hello everybody, I would love to propose a new solution for ticket #10216 which is currently a wontfix. Basically the problem is that with TEMPLATE_DEBUG turned on, Django expects a certain protocol from exceptions catched by the debugging system: Either an exception does not have a .source attri

Re: r9766-related issues

2009-05-12 Thread Armin Ronacher
Hi, On 13 Mai, 00:42, Yuri Baburov wrote: > Also on OS X you can set if filename is case-sensitive on per-volume > basis, when formatting, and usually it's case-insensitive. windows is > always case insensitive, linux is usually case-sensitive. I'm not talking about case sensitivity here but uni

Re: r9766-related issues

2009-05-12 Thread Armin Ronacher
Hi, On 11 Mai, 15:03, Marty Alchin wrote: > If you're using the filename to store it somewhere else, typically for > denormalization, it'd be better to do that post-save, since then you > know the record actually got saved in the database. Otherwise, you > might be trying to access the content o

Re: r9766-related issues

2009-05-11 Thread Armin Ronacher
Hi, All bugs are fixed now except for #10788. Now the problem with closing that one is that this one requires a design descision. I updated the ticket accordingly for jacob or anyone else to decide on it. My personal opinion is that I consider it bad design for the application to depend on the

Re: r9766-related issues

2009-05-07 Thread Armin Ronacher
Heyho, On May 7, 10:01 pm, Marty Alchin wrote: > It's not explicitly related to the MRO and method stuff you and Alex > have been working on, but it's definitely related to the r9766 > discussion, since it's caused by the delayed saving. I have a clear > understanding of the problem, but I don't

Re: r9766-related issues

2009-05-07 Thread Armin Ronacher
Hi, On May 7, 5:37 pm, Karen Tracey wrote: > #10249: can't create consistent MRO (method resolution order) when assigning > a File to a FileField. This is fixed. > #10300: custom storage backend can't get length of content to save. This *should* be fixed. I can't test it, no access to S3. > #

Re: r9766-related issues

2009-05-07 Thread Armin Ronacher
Hi, On May 7, 5:37 pm, Karen Tracey wrote: > So far as I know there 4 open ticks remaining related to r9766.  Three are > regressions so I believe something really needs to be done about them before > 1.1; one I think is just a bug in the new function.  Personally I'd rather > not revert the new

Concrete django.template Suggestions

2008-09-19 Thread Armin Ronacher
Hi everybody, After my quite controversal blog post about Jinja and Django I summed up some suggestions for the Django template engine that don't require a complete reimplementation / breaking backwards compatibility :) First of all the thread in-safeties I discovered [and the explanation why no

Re: RFC: django.template refactoring (#7806)

2008-09-18 Thread Armin Ronacher
On Sep 18, 12:52 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2008-09-17 at 14:42 +0100, Ben Ford wrote: > Parts of it are very well thought out and if it had been a post on "how > Jinja works" it would have been excellent. Other parts are completely > unconstrained by facts or ackn

Re: Escaping in templates...

2007-04-18 Thread Armin Ronacher
Hoi, Another small notice. Pylons and other frameworks thought about implementing "__html__" for objects that return an html representation of the object. If there is none it's converted to unicode and escaped. Adding something like "__html__ = lambda s: s" to the escaped string base classes coul

Re: #3527 - better debug traceback with code executing...

2007-04-16 Thread Armin Ronacher
Hoi, A possible solution would be moving the debug view from the core into a middleware. Then it's possible to replace the middleware and move the debugger into a contrib package. Regards, Armin --~--~-~--~~~---~--~~ You received this message because you are sub

Re: Escaping in templates...

2007-04-16 Thread Armin Ronacher
Hi, On Apr 16, 1:08 pm, Michael Radziej <[EMAIL PROTECTED]> wrote: > Armin, you're coming a bit late to this discussion. We had a few quite > extensive threads months ago. If you seriously want to engage in this > discussion, please read what's been written before. I understand that you > cannot

Re: Escaping in templates...

2007-04-16 Thread Armin Ronacher
Hoi, -sys.maxint for autoescaping. I added support for that into jinja quite a while ago and it was pain in the ass. It makes things more complicated (speaking for return values and arguments of filters) and it blows up the implementation. Not worth the work. Regards, Armin --~--~-~--~

Re: #3527 - better debug traceback with code executing...

2007-04-16 Thread Armin Ronacher
Hoi, -1 for the database interaction. The debugger should also work if the database is fucked up. Regards, Armin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, se

Re: Dictionary lookup with variable in template

2007-04-16 Thread Armin Ronacher
Hoi, What about using the Jinja approach? {{ foo.bar.baz }} is the same as {{ foo['bar']['baz'] }} So it's possible to use variables using this (where bar is a variable): {{ foo[bar].baz }} Regards, Armin --~--~-~--~~~---~--~~ You received

Re: #3527 - better debug traceback with code executing...

2007-04-09 Thread Armin Ronacher
Hoi, Alright. Patch here: http://pocoo.org/~mitsuhiko/django_debugger.patch Screenshot here: http://pocoo.org/~mitsuhiko/djangodebug.png (Note, I edited those files in the same checkout I did the patches for the __loader__ hook. So the patch is a bit bigger. Sorry for that) Enable by adding ENA

Re: #3527 - better debug traceback with code executing...

2007-04-09 Thread Armin Ronacher
Hi, On Apr 9, 1:48 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Instead, it is triggered by whether or not DEBUG is True. Sometimes you > want to have DEBUG=True in production environments, whether for just a > little period of time -- to debug something -- or for longer. So I am > relucta

Re: Status of SQLAlchemy branch

2007-03-30 Thread Armin Ronacher
Hoi, On Mar 29, 9:07 am, "Mir Nazim" <[EMAIL PROTECTED]> wrote: > Now can anybody tell me about the status of Django's SQLAlchemy > branch. I could not find any place describing the status on > code.djangoproject.com. Looks like it's pretty dead. Very sad. SQLAlchemy is kicking-ass, especially

__loader__ support for debugging module (#3734)

2007-03-30 Thread Armin Ronacher
Hoi, I filed this ticket (http://code.djangoproject.com/ticket/3734) some time ago and it's still marked as "Design decision needed" :). Now i added a patch and it works for me. I don't see any disadvantages in it so i hope someone can apply that patch. If not I would love to read comments about

Unbundling the ORM

2006-03-12 Thread Armin Ronacher
The django ORM is the best out there. The only problem is that it's only working from inside django. There is a ticket for that: http://code.djangoproject.com/ticket/1321 and a discussion here: http://groups.google.com/group/django-developers/browse_thread/thread/5b590b5487e500c1/c0f0d30cec89b107

Re: Jinja Template Engine

2006-02-26 Thread Armin Ronacher
I havn't compared with django but with some other template systems: [EMAIL PROTECTED]:~/Developement/area51/tpltest$ python tpltest.py Running Test 'jinja' TIME 0.00307821240425 Running Test 'kid' TIME 0.00703014059067 Running Test 'simpletal' TIME 0.0100415547848

{% recurse %} Tag

2006-02-25 Thread Armin Ronacher
Hiho :-) Yesterday I tried to implement a sitemap with jinja and i encountered a missing tag :-) The {% recurse %} tag. So whats this all about? A small example is here: http://wsgiarea.pocoo.org/trac/browser/jinja/trunk/unittests/tec/recurse.py The generated output is here: http://wsgiarea.poc

Re: Jinja Template Engine

2006-02-23 Thread Armin Ronacher
hugo wrote: > >Jinja isn't compatible with django templates. It uses a parser for the > >tag arguments > > A parser for tag arguments is available in Django, too - not all > template tags use only regexps. :-) You're right. Think i've overlooked it :-) Regards, Armin --~--~-~--~~--

Re: Jinja Template Engine

2006-02-23 Thread Armin Ronacher
Adrian Holovaty wrote: > On 2/22/06, Ivan Fedorov <[EMAIL PROTECTED]> wrote: > > What is Jinja? > > > > Jinja is a text-based template language similar to cheetah and Smarty. > > The syntax and parts of the code where taken from the django template. > > > > http://wsgiarea.pocoo.org/jinja/ > > Hey

Re: GvR prefers Django Template over Cheetah And Modularised Django

2006-02-03 Thread Armin Ronacher
I've created a ticket for this task: http://code.djangoproject.com/ticket/1321

Re: speeding Django up

2006-02-02 Thread Armin Ronacher
Does django provide a system for caching the nodelist? In Jinja I've added a loader which cpickles the nodelist using protocol 2 which is very fast because you don't have to parse it again. Additonally you can store the templates in an global dict like in the solution proposed in that thread: htt