Re: Ticket #34555 ModelBase prevents addition of model Fields via __init_subclass__

2023-07-22 Thread Jonathan Clarke
to deprecate, so if they're > breaking that may mean the change is not easy or even possible. > > On Fri, Jun 9, 2023 at 1:39 PM Jonathan Clarke < > jonathan.a.cla...@gmail.com> wrote: > >> Hi all, just wanted to check in to see if a conclusion can be reached on &g

Re: Ticket #34555 ModelBase prevents addition of model Fields via __init_subclass__

2023-06-09 Thread Jonathan Clarke
Hi all, just wanted to check in to see if a conclusion can be reached on this idea? Thanks :) On Tue, 16 May 2023 at 19:17, charettes wrote: > Just wanted to publicly +1 here as well. I was skeptical that we could add > support for it without invasive changes at first but it seems to be > relat

Claiming Tickets

2023-01-28 Thread Jonathan Wang
Hi all, I was reading up on the documentation for new contributors and was reading the "Claiming Tickets" section where it says "If a ticket for this issue already exists, make sure nobody else has claimed it. To do this, look at the “Owned by” section of the ticket. If it’s assigned to “nobod

Can I help?

2021-11-28 Thread Allen Jonathan
Dear Django Contributors, Hello! My name is Allen Jonathan. I'd love to contribute to the Django framework. I have a decent knowledge of python and a little of Django too. I'm a fast learner and can learn on the go. Please guide me on how to get started (even if its documentation

Re: new to contributing to open source

2019-12-14 Thread Jonathan Jackson
Hi all I a just beginning to learn Django today and I would like to get involved with the community. Let me know how I can help out. I will join the IRC so to. On Friday, November 29, 2019 at 7:41:13 AM UTC-5, Shruti Satish wrote: > > please point me to new and relatively easy bug fixes and also

Threads and requests with Channels 2.0

2018-03-20 Thread Jonathan Stray
d how this is possible in one Python process given the Global Interpreter Lock. Basically I am trying to reason about race conditions and scaling, and I don't have enough understanding to do it. Apologies if this is document elsewhere, but I've so far not been able to find it. - Jo

Re: Proposal: The 'use' template tag, a cross between 'include' and 'extends'.

2014-09-05 Thread Jonathan Slenders
There I think you are going one step too far. I think people should not be able to override blocks inside an included template in a "use"-block. That's one level too deep. It's confusing and you have other solutions for that. In the template that you "use", you could put a {% block %} around the

Re: Proposal: The 'use' template tag, a cross between 'include' and 'extends'.

2014-09-03 Thread Jonathan Slenders
From 2011: https://github.com/vikingco/django-template-tags/blob/master/src/django_template_tags/templatetags/decorate.py My proposal was refused back then, but I'll be very happy if something similar would make it. :) Le mercredi 3 septembre 2014 18:42:44 UTC+2, Jonathan Slenders a

Re: Proposal: The 'use' template tag, a cross between 'include' and 'extends'.

2014-09-03 Thread Jonathan Slenders
It's not similar. This implements the "decorator" pattern. Something that I've been proposing years ago. Le mercredi 3 septembre 2014 18:24:17 UTC+2, Ian a écrit : > > On Wed, Sep 3, 2014 at 10:10 AM, Sam Willis > wrote: > > Although I have implemented this with the 'use' word, there may be a

Solving the select+1 problem.

2014-06-11 Thread Jonathan Slenders
facebook/Haxl/tree/master/example/sql I don't know enough Haskel to understand this code, but it could contain some very nice ideas that apply to our ORM as well. Cheers, Jonathan -- You received this message because you are subscribed to the Google Groups "Django developers" group.

Re: The unsettings project

2014-02-25 Thread Jonathan Slenders
Not sure whether this has already been covered. Maybe it is. I'd like to specify the settings as a class instead of a module. Mostly because I don't like the "from settings_local import *" pattern to extend some base settings with machine specific settings. By having the possibility to define i

Re: Issue with save/save_model/clean from admin (django 1.6.3dev)

2014-02-25 Thread Jonathan Pentecost
I _think_ your problem might lie in the confusion between "blank" and "null"; taken from https://docs.djangoproject.com/en/dev/ref/models/fields/#blank; null is purely database-related, whereas blank

Re: [GSoC] Switching to Jinja2 proposal

2014-02-10 Thread Jonathan Slenders
For any refactoring of the template engine, going to jinja2, etc... it would very much help to look at this ticket first: https://code.djangoproject.com/ticket/20434 It's a backwards compatible patch, which allows template tags to be written in a much more declarative way, without exposing any

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 templ

Re: Add a generic "getter" filter to the built-in library

2013-11-04 Thread Jonathan Slenders
Le lundi 4 novembre 2013 14:13:44 UTC+1, Emanuele Bertoldi a écrit : > What about the *add* filter? ;) > I forgot about that one. However, there's probably a reason. It's hard to fix the templating engine and implement a "+" operator. Because people would expect that whitespace around the "+"

Re: Add a generic "getter" filter to the built-in library

2013-11-04 Thread Jonathan Slenders
gs, but not against filters.) B.t.w. if anyone has template engine related patches ready, I'm always willing to review it. Cheers, Jonathan Le lundi 4 novembre 2013 01:24:45 UTC+1, Russell Keith-Magee a écrit : > > > On Sun, Nov 3, 2013 at 9:57 PM, Emanuele Bertoldi > >

Re: Possible idea for removing global state in Django.

2013-10-21 Thread Jonathan Slenders
equivalent to regular >> variables in >> > tests because they are single threaded (with a handful of exceptions). >> But >> > allowing testing in isolation is a major goal of "removing global >> state". >> >> If I understand correctl

Re: Possible idea for removing global state in Django.

2013-10-16 Thread Jonathan Slenders
Le jeudi 17 octobre 2013 01:26:20 UTC+2, Russell Keith-Magee a écrit > What's wrong with thread local storage? Well, try this though experiment. > > Everywhere that you see the word "thread local", replace it with "global > variable". Now re-read your argument. > > It doesn't matter how you

Possible idea for removing global state in Django.

2013-10-16 Thread Jonathan Slenders
on projects and that unit testing becomes easier: you don't have a global state. What do you think? I don't see real backward-compatibility issues that we can't solve. Do I forget something? Cheers, Jonathan [1] https://www.youtube.com/watch?v=0FD510Oz2e4 [2] https://github.

An argument against mark_safe.

2013-10-16 Thread Jonathan Slenders
Currently, on python-ideas there is a discussion going on about taint tracking in Python. It's tracking data that come from untrusted sources and preventing it from being used in sensitive places. This video [1] from last year explains the problems very well. In noticed that we can do better

Re: Add strutctured settings module to django 1.7?

2013-10-02 Thread Jonathan Slenders
There's nothing that prevents anyone to track the configuration of the environment in a VCS. The guideline that it shouldn't be in the repository of the application source code is not against that. Deployment systems should be able to set-up the environment automatically, (by generating a setti

Re: Support POST of application/json content type

2013-09-04 Thread Jonathan Slenders
Would that mean that the object returned by request.DATA/POST/whatever could be a different type, depending on what the user posted? I don't want to see code like: if isinstance(request.DATA, YamlObject): ... elif isinstance(request.DATA, dict): ... although, I'm not sure how any view could han

Re: Hybrid Property request

2013-07-17 Thread Jonathan Slenders
Oh, and denormalisation is not necessarily faster. If you're able to express the value of the column as an SQL expression, it's possible to put an index on such an expression. Le mercredi 17 juillet 2013 13:18:16 UTC+2, Jonathan Slenders a écrit : > > This is really nice. Bot

Re: Hybrid Property request

2013-07-17 Thread Jonathan Slenders
This is really nice. Both have their use cases, but I'm prefering the second when possible, because it's much more flexible and preserves database consistency. With the same efford you can make the following work: ProductEntry.objects.filter(lambda p: p.onpurchase_price * p.quantity == 5000.0)

Re: Limitation for Named Urls for reverse url resolve.

2013-07-12 Thread Jonathan Baker
subscribed to the Google Groups > "Django developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To post to this group, send email to django-developers@googlegroups.com. > V

Re: Keep template tags grammar (for simple_tag, assignment_tag and inclusion_tag. Extend with block_tag). Ticket 20434 and 20435.

2013-06-05 Thread Jonathan Slenders
If someone has some spare time. Take a look at this ticket: https://code.djangoproject.com/ticket/20434 The implementation is finished and consists of 4 patches. See the ticket for more information. Thanks! -- You received this message because you are subscribed to the Google Groups "Django de

Re: Not calling things twice in templates

2013-06-03 Thread Jonathan Slenders
We don't even have to change the for-syntax: {% for bee in my_bonnet.bees %} {% loop %} {{ bee }} {% endloop %} {% empty %} No bees! {% endfor %} Le mardi 4 juin 2013 00:03:12 UTC+2, Shai Berger a écrit : > > > {% for my_bonnet.bees %} > >

Re: Not calling things twice in templates

2013-06-03 Thread Jonathan Slenders
By the way, this could also be implemented using just files. The way {% include %} works for macros. If that's preferred. That becomes: {% decorate "my_special_for.html" data %} {{ i.value }} {% enddecorate %} Le lundi 3 juin 2013 13:38:29 UTC+2, Jonathan Slenders a écr

Re: Not calling things twice in templates

2013-06-03 Thread Jonathan Slenders
Hi all. In the past, I once proposed a decorate template tag, but it was disapproved back then. This would be another solution, to make the template language a lot more powerful. 1. First you define a decorator, for the behaviour you'd like to have. The "data" parameter indicates the receiving

Re: Keep template tags grammar (for simple_tag, assignment_tag and inclusion_tag. Extend with block_tag). Ticket 20434 and 20435.

2013-05-24 Thread Jonathan Slenders
de, etc... part of the public API? They don't appear anywhere in the documentation. It is because if I implement the new template tag definitions, I'l like to refactor all the built-in template tags to use the new style. (As using more of Django -- inside Django.) And this can probably break

Keep template tags grammar (for simple_tag, assignment_tag and inclusion_tag. Extend with block_tag). Ticket 20434 and 20435.

2013-05-20 Thread Jonathan Slenders
What do you think would be good as a format, maybe the following? if elif* else? endif for empty? endfor ... ... Further, the following line does not say anything about the template tag parameters. @register.block_tag('if elif* else? endif') Should we add some syntax to tell which t

Re: Automatic deployment tool

2013-05-16 Thread Jonathan Slenders
hat's not shown, but great: - typing "--connect" will open a bash shell on the remote end of the current node. - introspection of everything - a lot more. Feedback is very welcome, but maybe keep it off django-developers. https://github.com/jonathanslenders/python-deployer/

Nested blocks in base template.

2013-04-27 Thread Jonathan Slenders
n that much progress last year.) Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com

Re: websockets

2013-04-16 Thread Jonathan Slenders
Maybe it's worth noting that Guido is working on a Tulip, a specification for an asynchronous API in Python 3, this to get some consensus. Right now, there is almost zero compatibility between al the different approaches: twisted, tornado, gevent, etc... If we decide to go for one technology, b

Re: javascript view for named urls

2013-03-31 Thread Jonathan Slenders
As Andrew says, some "rely" on the obscurity of this server side information. The same can be said of translations. I'd like to see better support for javascript preprocessing. gettext(...) in javascript could be preprocessed if the language is known. url_resolve('name', { ...}) could probably a

Re: Moving database backends out of the core

2013-03-05 Thread Jonathan Slenders
midldeware=..., ) No disadvantages I think. But it's not an easy migration path. Cheers, Jonathan -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, sen

Re: TIMEZONE default

2013-02-09 Thread Jonathan Loy
Z. > > If you search the archives of this mailing list you'll find a detailed > explanation for USE_TZ. > > -- > Aymeric. > > > Le 9 févr. 2013 à 23:44, Alex Ogier > a > écrit : > > Hi Jonathan, > > I don't know the particular history of thi

TIMEZONE default

2013-02-09 Thread Jonathan Loy
7;t they be the same, and if so which one? Thanks for taking the time to read/answer my queston. v/r Jonathan -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, sen

Re: Automatic deployment tool

2012-12-09 Thread Jonathan Slenders
ther people. Cheers, Jonathan Le lundi 10 décembre 2012 00:15:58 UTC+1, Cal Leeming [Simplicity Media Ltd] a écrit : > > Hi Jonathan, > > Just from a very brief point of view.. my eyes started to glaze over > whilst looking at the github README, and even more so when I looked a

Automatic deployment tool

2012-12-09 Thread Jonathan Slenders
ent/deployer/contrib/services/django.py I'll publish one of these days on pypi. All feedback is welcome. For bugs/feature requests on things which arn't Django related, please go to the github. Cheers, Jonathan -- You received this message because you are subscribed to the Google Gr

Model inheritance extended.

2012-09-24 Thread Jonathan Slenders
sed before. And whether, if useful, this would make a candidate for django.db. https://github.com/citylive/django-model-blueprint Cheers, Jonathan -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on

Re: suggestion: Don't make the tag "url" dirty in Django1.5

2012-03-27 Thread Jonathan French
That example is incorrect. {% url app_views.client %} will not change to {% "url app_views.client" %} it will change to {% url "app_views.client" %} which, as you can see, enables passing the view from something other than a literal string. On 27 March 2012 09:22, gs412 wrote: > In Django1

Re: [GSoC 2012] Schema Alteration API proposal

2012-03-19 Thread Jonathan French
On 18 March 2012 23:33, Russell Keith-Magee wrote: > > 2. An inspection tool that generates the appropriate python code after > >inspecting models and current state of database. > > The current consensus is that this shouldn't be Django's domain -- at > least, not in the first instance. It mi

Re: Class based views: A standard hook for http-method-independent code

2012-03-02 Thread Jonathan French
ak the rules. > > > Cheers, > AT > > > On Fri, Mar 2, 2012 at 11:53 AM, Jonathan French > wrote: > >> That's true, but I agree it seems a useful enough hook to make it a hook, >> rather than needing to do it yourself like that. I would vote for it being >

Re: Class based views: A standard hook for http-method-independent code

2012-03-02 Thread Jonathan French
That's true, but I agree it seems a useful enough hook to make it a hook, rather than needing to do it yourself like that. I would vote for it being called 'preprocess', to make it clear that it's both optional and run before the method-specific function. - ojno On 2 March 2012 13:40, Michael van

Re: make the File Storage API works with a file-like object instead of the Django File object.

2012-02-28 Thread Jonathan French
You can create a Django file object from any file-like object just by passing it to the constructor. django.core.files.File(my_file_like_object) This is basically what all the storage backends do where there is an existing file object from whatever source, and what you have to do if you want to s

Re: Newline stripping in templates: the dnl way

2012-02-25 Thread Jonathan French
Let me make sure I've got this right --- The situation being discussed is not where whitespace is insignificant and can be stripped, but where whitespace is important and you want to control the exact amount of it, e.g. plain text emails. In this case, just using stripwhitespace is not enough. Righ

Re: Revisiting multiline tags

2012-02-24 Thread Jonathan French
On 24 February 2012 17:16, Alex Gaynor wrote: > > > On Fri, Feb 24, 2012 at 12:06 PM, h3 wrote: > >> > If you'd like to make an argument as to *why* it's useful, that's >> useful, but we don't take polls. >> >> I think the argument as to why it's useful as been made quite >> extensively. >> >> O

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Jonathan French
Jinja implements whitespace control by putting a minus sign after/before the % in a tag - http://jinja.pocoo.org/docs/templates/#whitespace-control - I haven't tried it myself, but it looks like {% tag -%} is equivalent to your {% tag %}{# . On 24 February 2012 17:37, Tobia wrote: > Tai Lee wrot

Re: Revisiting multiline tags

2012-02-24 Thread Jonathan French
Since we're consensus building or whatever the fancy term is, another +1. Mainly for comments, since {# #} is far, far more readable than {% comment %}{% endcomment %} even with syntax highlighting, but also for other tags too, particularly long i18n ones -- or even relatively short ones where you

Re: auth.User usernames

2012-02-17 Thread Jonathan Slenders
On 16 fév, 13:05, Tom Evans wrote: > 75 isn't large enough these days for either email or username. We run > a patched version of django for some time that has changed both these > fields to 255 characters in order to accommodate the needs of our > users. See RFC 3696. This and other issues made

Re: start using less (and bootstrap!)

2012-02-14 Thread Jonathan Paugh
projects could be tarball-ed together somehow. (Could it be that hard to teach setup.py to install another package from a subdir? Or to tar up them separately?) (And what is virtualenv? Do I need it to install admin? Let's address that in a separate tutorial, with a link and a notation.) P

ticket/15926, advice

2012-02-07 Thread Jonathan Paugh
s patch to a (much) later tip of the git repo, and expanded it's scope as per my comments on the ticket page. I also added some documentation for my changes, which I believe is adequate. Thanks for your help. Jonathan -- You received this message because you are subscribed to the Google

Re: GSoC 2012 Proposal

2012-02-07 Thread Jonathan Paugh
ore dev and don't influence such decisions.) I believe someone recently suggested incorporating less (http://lesscss.org/) and bootstrap (http://twitter.github.com/bootstrap) into Django, and this might be something you're interested in. At any rate, this list is full of good propositions.

CacheMiddleware with generation-style caching

2011-10-31 Thread jonathan
E_MIDDLEWARE_SECONDS for the Cache-Control headers? Obviously, I can make this change locally, but I'd like to know if I'm missing something and if this change has any chance of making it upstream. :) Thanks! Jonathan [1] http://assets.en.oreilly.com/1/event/27/Accelerate%20your%20Rail

Re: common variable (Deploying Feature in manage.py)

2011-10-25 Thread Jonathan Slenders
production or not. The only reason for such a variable to exists, may be to decide between several other settings to include. Correct me if you think differently. Cheers, Jonathan -- You received this message because you are subscribed to the Google Groups "Django developers" group. T

Re: Deploying Feature in manage.py

2011-10-24 Thread Jonathan Slenders
ource code on github and I'll post a link in django-users -- hopefully somewhere within the following two weeks. By the way, any input of what you think a deployment tool should have, or what you think that other tools lack is welcome. (send me in PM) Cheers, Jonathan -- You received

Re: RFC: "universal" view decorators

2011-09-16 Thread Jonathan Slenders
I agree with Donald's reasoning. Decorators belong to functional programming, not to OO programming. Though, I still like to keep using functions for my own views and there are decorators appropriate. But if you go class based, you better use inheritance. However, instead of mix-ins, I'd rather pr

Re: Advice on #13260 - '%' in args to urlresolvers.reverse()

2011-08-23 Thread Jonathan Slenders
se('my_page') We should also make a decision about whether the regex in the urlpatterns are written quoted or unquoted. I would say, keep these unquoted for readability. >> url(r'^some-%-url/$', ...) If we have the following patterns: >> url(r'^(?Psome-%-url)/$&#x

Re: RFC: staticfiles "static" template tag and CachedStaticFilesStorage

2011-08-11 Thread Jonathan Slenders
from staticfiles.utils import staticfile_open filepointer = staticfile_open('my-relative-path...') Thanks, Jonathan On 8 août, 12:17, Jannis Leidel wrote: > Hi all, > > I believe I'm getting close to a fix for #15252 which would add > a bunch of new features to the staticfiles c

Re: minify static files (css and js)

2011-08-08 Thread Jonathan Slenders
This one is a more powerful compressor, but does not easily work out of the box on every website: https://github.com/citylive/django-template-preprocessor I personally think there are too many ways of minifying content. Minifying is about making assumptions about what information in the files you

Re: Consistent exception handling in templates.

2011-07-08 Thread Jonathan Slenders
Something related I was wondering about... Errors in templates should be silenced -- I agree with that -- but only when they are caused by an error in the template. Variable.resolve can fail silent because that's caused by the template author, who is referring to non-existing variables. However,

Re: Reversing translated urls in templates

2011-07-05 Thread Jonathan Slenders
I'm also +1 on {% language lang_code %}... {% endlanguage %} We are using exactly this template tag for maybe about half a year already. Not for i18n urls, but for formatting numbers. The decimal separator in Dutch is a comma, but sometimes we want to be sure to have a dot a some part of the templ

Re: WSGIRequest._stream.read() blocking

2011-06-14 Thread Jonathan Slenders
Thanks Roberto, We had UWSGI 0.9.6.8 installed first. Now I did an upgrade to 0.9.8 and now everything works perfect. Thanks a lot for the quick response. On 14 juin, 15:00, Roberto De Ioris wrote: > Il giorno 14/giu/2011, alle ore 14.54, Jonathan Slenders ha scri

Re: WSGIRequest._stream.read() blocking

2011-06-14 Thread Jonathan Slenders
if I replace: > if type(socket._fileobject) is type and > isinstance(self.environ['wsgi.input'], socket._fileobject): by: > if True in django.core.handlers.wsgi.py Then, everything works perfect, so it has to be in this check. -- You received this message because you are subscribed to the Go

WSGIRequest._stream.read() blocking

2011-06-14 Thread Jonathan Slenders
Django, but I'm not sure where exactly. By the way, it would also be great if anybody knows how to use pdb statements, while running uwsgi on the console. Thanks! Jonathan -- You received this message because you are subscribed to the Google Groups "Django developers" group. T

Re: Django Error Display Page

2011-06-09 Thread Jonathan Slenders
On 9 juin, 10:51, Tom Evans wrote: > I disagree entirely. The stack trace is the first thing I look at, and > whilst we need to make it easy for people to learn django, we > shouldn't be hiding essential information from people - even if it is > just hidden in a separate 'tab'. Me too. Why is

Re: get_object_or_404 hook

2011-06-09 Thread Jonathan Slenders
Indeed, this is nothing that has to be in the Django core. You can do something like this: http://dpaste.com/hold/552209/ Although, I do not think that's the best solution. By catching all DoesNotExist errors, the Django middleware will not receive the exception anymore and exception logging fram

Re: Vote on {% include %} behaviour.

2011-06-03 Thread Jonathan Slenders
clude behaviour when using variable template names. Maybe anyone else? Cheers, Jonathan -- 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@googlegroups.com. To unsubscrib

{% trans %} and safestring.

2011-05-30 Thread Jonathan Slenders
This is something I have been questioning myself for a while now. Is the current behaviour of {% trans %} like it should? We have safe_string, which marks a string as safe for being rendered in HTML. {% trans %} blocks appear to be always considered safe. So {% trans "test" %} will render strong

Re: jQuery.tmpl() and Django

2011-05-27 Thread Jonathan Slenders
RT,BLOCK_TAG_END,...} On 27 mai, 09:07, Michael Blume wrote: > Would it be possible to customize the markup Django uses for template > compilation, either at the project level, at compile-time, or embedded in > the template itself? > > -Mike > > On Thu, May 26, 2011 at

Re: jQuery.tmpl() and Django

2011-05-26 Thread Jonathan Slenders
% verbatim "===" %} ... {% "===" %} Cheers, Jonathan On 27 mai, 07:04, Sean O'Connor wrote: > I think it would be a bit much for us to ask the jQuery crew to change their > template language to avoid conflict with ours. Aside from the amount of > backwards incompatible wor

Re: Template inheritance and duplicated content.

2011-05-24 Thread Jonathan Slenders
Even more confusing, but extremely great to abuse! base.html {% block a %}{% endblock %} {% block b %}{% endblock %} {% block c %}{% endblock %} {% block d %}{% endblock %} {% block e %}{% endblock %} index.html {% block a %} {% block b %} {% block c %} {% blo

Template inheritance and duplicated content.

2011-05-24 Thread Jonathan Slenders
art using this flaw as a kind of macro-feature, to intentionally duplicate content. Jonathan -- 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@googlegroups.com. To unsubscrib

Re: RFC: Templatetag API for form rendering

2011-05-23 Thread Jonathan Slenders
1. Like Carl said, I always prefer template tags which alter the context to create a scope. (I hate {% url ... as varname %}) {% form "table" %} {% renderform my_form %} {% endform %} 2. Also totally agreed with Russell that we need consistency about when template tag parameters need to be q

Re: Bug in DateTimeInput: localization formatting decided during start-up?

2011-05-16 Thread Jonathan Slenders
Ticket created. http://code.djangoproject.com/ticket/16038 -- 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@googlegroups.com. To unsubscribe from this group, send email to django-develo

Bug in DateTimeInput: localization formatting decided during start-up?

2011-05-09 Thread Jonathan Slenders
round this issue is welcome :) Cheers, Jonathan I propose that Field.__init__ should have localize=None, and if no localize parameter has been given, set self.localize according to USE_L10N in the settings. -- You received this message because you are subscribed to the Google Groups &q

Re: Django urls in JavaScript

2011-05-04 Thread Jonathan Slenders
ations. And further, I think that the urls and names of views are not meant to be exposed to the client. I don't want a visitor to be able to reverse engineer my website, and read all the possible URL patterns. Jonathan -- You received this message because you are subscribed to the Google Gro

Re: Suggestion for improvement to template block/extends tags

2011-05-04 Thread Jonathan Slenders
ommonly used in languages like XAML.net. It is more readable and compact than the only current alternative: including a template and using {% extends %} inside the include. cheers, Jonathan -- You received this message because you are subscribed to the Google Groups "Django developers"

Re: Suggestion for improvement to template block/extends tags

2011-04-29 Thread Jonathan Slenders
Hey, this pattern are nested decorators in templates. Most people here are probably against having nested template tags with the same name. I think it does only make sense when there's somehow a distinction between a "placeholder" and "content". Because otherwise, templates don't know which block

Re: Fixing makemessages for Javascript

2011-04-19 Thread Jonathan Slenders
tead of the ugly {% trans %} within quotes have no more disadvantages. And while everything is processed, it's rather easy log all the strings which are to be translated on the way. Cheers, Jonathan On 19 avr, 15:50, Łukasz Rekucki wrote: > On 19 April 2011 15:35, Jonathan Slenders

Re: Fixing makemessages for Javascript

2011-04-19 Thread Jonathan Slenders
n catalog for javascript is no longer required, even for external files. https://github.com/citylive/django-template-preprocessor cheers, Jonathan On 18 avr, 00:14, Ned Batchelder wrote: > On 4/15/2011 12:40 PM, Russell Keith-Magee wrote: > > > > > > > > > On Fri, Ap

Re: DDN: #2594 (Template system whitespace) may cause blocktrans issue

2011-04-18 Thread Jonathan Slenders
Some concerns, even if I don't know much about the subject. Are you sure that it's always appropriate to strip indentation? Some companies (like us) use templates for other stuff than HTML. (like plain text mail.) In this case the indentation is meaningful (not to the translator, but important for

Re: GSoc : Templates Compilation , draft 2

2011-04-12 Thread Jonathan Slenders
riting a parser or compiler, but it can sometimes take many times of refactoring and rewriting code before you get a satisfying enough result. By the way, someone in this group said that l10n takes a lot of time during template rendering. I wonder what we can do about that... Have a nice day, Jona

Re: GSoc : Templates Compilation

2011-03-31 Thread Jonathan Slenders
nal implementation to the new implementation as an additional function parameter. (As a curry.) I guess it's fast, and can be cached in memory. For each rendering, only a copy of the required template dictionaries have to be made. (Not even a deep copy.) --- Cheers,

Re: GSoc : Templates Compilation

2011-03-31 Thread Jonathan Slenders
Hi Andrey I haven't yet looked through all of your code, but already a little feedback. Remember that every dot operator requires a dictionary lookup or getattr call. Also the [ ]-operator is another level of redirection. I think using 'self' inside a for-loop is not a good idea. If you're going

Re: GSoc : Templates Compilation

2011-03-30 Thread Jonathan Slenders
How exactly do you want to solve dynamic inheritance? It seems that some people are still interested in dynamic inheritance, by using {% extends variable %}. (Which is still dirty in my opinion, but anyway.) Block information has to be kept somehow. Maybe one small improvement. Isn't the followin

Re: Django Template Compilation rev.2

2011-03-30 Thread Jonathan Slenders
enario. I don't know whether using a 'result' variable is the best way. But if it is, you could turn a filter tag into the following code and nest in your other generated code. So, it'll override 'result' in the inner scope. > def _f(): >result = [] >... >

Re: Proposal for Template Engine Refactoring

2011-03-29 Thread Jonathan S
+1 on this. Are you planning on keeping the API for registering template tags compatible? (django.template.Library.register.tag) I think this may be required for backwards-compatibility, but personally, I'd like to see a cleaner API for this, which doesn't expose the parser details. (Writing temp

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 Jonathan S
me know if you have other questions. There is more I have to tell, but I'm a little busy right now... Have a nice day, Jonathan -- 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

Bug in ManyRelatedManager.get_query_set?

2011-02-24 Thread Jonathan S
a query Model2.objects.get(id=...) to be executed. Model1 is defenitely not involved, so I think there's no reasen to pass Model1 to the router, instead of Model2. This patch should solve it: http://paste.pocoo.org/show/343888/ cheers, Jonathan -- You received this message because you are subs

Re: Missing semi-colon

2011-02-24 Thread Jonathan S
Thanks, I made a patch and created a ticket. http://code.djangoproject.com/ticket/15490 On 23 fév, 13:48, Russell Keith-Magee wrote: > On Wed, Feb 23, 2011 at 8:24 PM, Jonathan S > wrote: > > Aparently, there are several semicolons missing at several places: > > >

Re: Missing semi-colon

2011-02-23 Thread Jonathan S
Aparently, there are several semicolons missing at several places: django/contrib/admin/templates/admin/edit_inline/tabular.html lines 90, 94 and 124 django/contrib/admin/templates/admin/edit_inline/stacked.html lines 45, 48 and 78 Of course, this really is a minor issue, but easy enough to fix

Missing semi-colon

2011-02-23 Thread Jonathan S
SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% admin_media_prefix %}"); }) } } Thanks a lot, Jonathan -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this grou

Re: Proposal for inclusion of two additional default template tags.

2011-01-07 Thread Jonathan S
> Regarding the macro-tag I think the idea is valid but I'd personally > prefer a more flexible approach regarding variables being  provided > for the macro block. Something like Jinja's macro comes to mind where > I can define parameters for each macro and then pass them in as needed Jinja's appr

Re: Proposal for inclusion of two additional default template tags.

2011-01-07 Thread Jonathan S
Jonas H." wrote: > On 01/07/2011 05:11 PM, Jonathan S wrote: > > > ** And a {% decorate %} template tag: > >http://paste.pocoo.org/show/316593/ > > +1 > > > {% macro %} avoids the usage of external template files. I think it's > > not worth the over

Proposal for inclusion of two additional default template tags.

2011-01-07 Thread Jonathan S
wether you'd like to see something different. - Jonathan -- 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: i18n bug in template rendering.

2011-01-06 Thread Jonathan S
Thanks Ramiro, we hope the patch will be applied in the next release. -- 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 dj

Re: i18n bug in template rendering.

2011-01-06 Thread Jonathan S
> You aren't supposed to use _('Foo') as a standalone variable. > (see last paragraph > herehttp://docs.djangoproject.com/en/1.2/topics/i18n/internationalization...) Why shouldn't I use it as a standalone variable? (A language should have a *context free* grammar, which means, that the undersco

  1   2   >