Re: a new template algorithm
At first let me say that I really appreciate your reply! Thanks. On Aug 30, 6:48 pm, Tim wrote: > Alex briefly mentioned the design decision of the template system, but > I think it'd be good to emphasize his point-- Django was designed to > have various layers, such as the urls, the views, the templates, etc. > If you think about it, different people within a large project could > actually be in charge of different layers, free to change certain > things without breaking the other layers. If the templates make > proper use of the {% url %} templatetag, a urls designer can make > small changes the URL structure without breaking the site at all. Yes, I understand that. I've just sent you what I did just because I think it's interesting and if you had found it interesting too you could include (the way was completely in your hands) in the project. I thought issues related to backward compatibility and "python syntax for non python programmers" could be solved quite easily. What I'm trying to say is that my sending you the template engine I developed was something like "Hey guys, I did this, are you interested?", in a full open source philosophy. I'm using it currently in my sites and I think it's very easy, powerful and quick to develop, and no one of the template engines (Tornado, ...) use this algorithm, so I'll sure keep using my django patched version. Thanks, Gabriele -- 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 django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: a new template algorithm
Hi, On Aug 31, 5:52 am, "burc...@gmail.com" wrote: > Why you patched Django instead of making a connector so everyone would > be able to use your template engine without patching django? This is how the whole thing started. I started a new job and the one that was in charge of the projects before me chose to use django. I had never used django before this job. After a while that I spent time to develop new tags and filters especially for new projects, I began to think a way to implement a template engine that would let me no more write sort of "plugins" like tags and filters, a thing that really bother me. As all the previews projects were based on django the easier and faster thing to do was to start changing the django template. Now that I'm back working on my business projects (that as you can understand is the priority) I can think what to do with it. I can keep it just mine but at first I thought I could have an opinion from you. > Looking at your django patch, you also seems to have a typo in your > Http500 page rewrite: > -Request Method: {{ request.META.REQUEST_METHOD }} > -Request URL: {{ request.build_absolute_uri|escape }} > +Request Method: {{ request.META['RQUEST_METHOD'] }} > +Request URL: {{ escape(request.build_absolute_uri) }} Yes thanks, you are right, bad typing. > From the engineering point of view, you did nothing important. In > fact, I think, you did a bad thing to Django: > By increasing the number of incompatible template engines for django, > you fraction the user base of each one, so you decrease the overall > quality of Django solutions, and Django plugins won't be that good (if > they provide any templates). I believe, new template engine should be > made only if it will be much better than old one (i.e, look at Razor > template engine from Microsoft ASP.NET team). I know that but it is a completely different platform/system/ For the "incompatibility" issue I agree with you. To have only template engines fully compatible is one of your priorities. I understand and no problem with that. I sent you my work as you could have a look at it and see if it is interesting and, as I said already many times, if you had find it interesting it could be used as you wish. ABSOLUTELY in my mind there was NOT the idea of proposing a changing to the django template engine. > Your work also makes me think you haven't ever heard of Jinja2 and > Mako, both of which already do what you need (python programming in > templates), but have good documentation and have proper way to connect > to Django. In my opinion this is not true. I know Jinja and it works differently. Just looking at the Variables and Filters part of the documentation (or looking at the source if you prefer) you can see that it's different. For example I didn't want to do something like this (as in Jinjia is needed): {% if loop.index is divisibleby 3 %} > From the teenager point of view, look, you created new cool template > engine! Wow! You rock! ..no comment about this. Gabriele -- 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 django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: a new template algorithm
On Aug 31, 10:20 am, Luke Plant wrote: > On Tue, 2010-08-31 at 10:52 +0700, burc...@gmail.com wrote: I guess Luke is right. I needed something and I implemented it because I couldn't find it done as I wanted by no others. A priority was Python on linux system (so no windows, .NET, ...) and to have it as soon as possible. I asked an opinion from you at first because I based my work on django. The fact that you are not interested is _obviously_ not a problem for me and I understand that. I don't think I have done something special with this thing but just something I needed. What I don't understand is the reply of some of you that pretend to "teach" me something in all the ways thinking that I need "lessons", or supposing that I feel like I found a prime number with at least 1,000,000,000 decimal digits. I don't feel so and I don't think that me sending you something to evaluate should bother you. Either no reply or just "No thanks" would have been enough for me. Anyway Thank you very much to everybody for the replies. Gabriele -- 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 django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: a new template algorithm
2010/8/28 Alex Gaynor : > With all due respect: no. The template system is intentionally not > Python, this is a strong design decision and I see no compelling > argument against it here. If you're just generally interested in the > compilation of Django templates to PYthon (without changing the > current semantics) I suggest you take a look at : > http://www.mail-archive.com/django-developers@googlegroups.com/msg25147.html, > which was a GSOC proposal I wrote (and ultimately withdrew in favor of > my query-refactor work), it presents a method for translation of > Django templates into Python code, while maintaing the current > semantics. Frankly, this is not what I did and I'm not interested about that. > As a small sidenote, when proposing a change a patch should contain a > single change, rather than a number of unrelated ones. Thank you very much for the lesson But I already knew. It would have taken time to produce different patches and test every single one (as many of them are NOT unrelated) when what I just wanted to know was if you were interested in my template system, and this was only a demostration version. Then if you were interested, I would have refined the work and then produced the single patch. As a small sidenote, I was not proposing a change but something to add if you would have read carefully my email. As a second small sidenote, I'm glad that I didn't waste my time. Thanks, Gabriele -- 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 django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.