#29752 Adding a ALLOWED_HOSTS_IGNORABLE_URLS setting

2018-09-14 Thread Jonas H
Hi, I've started a discussion on https://code.djangoproject.com/ticket/29752 to add a new ALLOWED_HOSTS_IGNORABLE_URLS setting. The setting can become handy if you can't control the Host header sent to your application but still want to accept the request. An example of this is health checks

Re: Runtime error

2017-11-09 Thread Jonas H
Not sure if this is what's meant by the first post, but I got very confused the other day by the ./runtests.py script: If you run ./runtests.py ../tests/foo, it crashes with all sorts of "X doesn't declare explicit app label" exceptions. If you run ./runtests.py foo, it works. Not sure why I

Templates: __html__ method support

2017-09-26 Thread Jonas H
Proposal: Support the __html__ method as an alternative/addition to the __str__ for turning objects into strings in the template layer. If this has been discussed before, please point me to it; I couldn't find anything with the search function. Some custom classes may have, in addition to a

Re: Possible bug transaction rollback or SQLite backend

2015-12-09 Thread Jonas H.
> On 03 Dec 2015, at 17:04, Carl Meyer wrote: > >> I use Python 3.5, SQLite 3.9.2 and I can reproduce the crash on Django >>> =1.8.4,<1.9. > > This might be useful information to add to > https://code.djangoproject.com/ticket/24080, if it's not already present > there. > >

Re: Possible bug transaction rollback or SQLite backend

2015-12-03 Thread Jonas H
Tim, thanks for the pointer. I'm not sure if my issue is related. I've found a minimal example for another (same?) issue: https://code.djangoproject.com/ticket/25860 -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django

Possible bug transaction rollback or SQLite backend

2015-12-03 Thread Jonas H
Hi there, there seems to be something wrong with either the SQLite backend, the SQLite library itself or Django's transaction handling. Whenever I try to run the test suite of a specific project of mine (https://github.com/jonashaag/fahrtkostenrechner), using `fahrtkostenrechner/manage.py

Django 1.9 AppRegistryNotReady

2015-09-28 Thread Jonas H
Hello all, I'm not sure if it's expected behaviour, so I thought I'd rather report this here: I've had issues importing multiple (well[ish]-known) 3rd party apps with Django 1.9 that import fine on Django 1.8. The error I'm getting is AppRegistryNotReady, caused by some (indirect) import to

Re: Django-nonrel patches

2012-06-26 Thread Jonas H.
On 06/26/2012 11:07 PM, Adam "Cezar" Jenkins wrote: Last I heard Jonas wanted to do a new release of mongodb-engine. He might have meant to say he was not maintaining the project anymore, but he's not the only one with commit access. The main thing is that I've lost interest in maintaining

Re: gsoc proposal, dynamic list form field

2012-03-25 Thread Jonas H.
tl;dr: http://gsoc-demo.herokuapp.com/addrecipe (the "Ingredients" forms) -- 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

Re: Revisiting multiline tags

2012-02-24 Thread Jonas H.
On 02/24/2012 10:01 AM, Stephan Jaensch wrote: This thread contains 6 people expressing support for this change, and 2 against (a BDFL, a core developer) -- and you can add me to the -0 list. There are over 6000 subscribers to django-developers. I put it to you that the vast majority of

Re: Issue in sending email

2012-02-02 Thread Jonas H.
Please post questions about using Django on django-users, not here. The topic of this list is the development of Django itself. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to

Re: Django-nonrel patches

2012-01-08 Thread Jonas H.
On Sun 08 Jan 2012 05:39:02 PM CET, Emil Stenström wrote: On Thursday, December 8, 2011 10:31:39 PM UTC+1, jo...@lophus.org wrote: 1.) I didn't write the code, I'm just submitting the patches in their current state Jonas: Do you have information on who wrote the code that you submitted? I

Re: #16630: Support for HTML5 input types

2011-12-28 Thread Jonas H.
On 12/28/2011 05:15 AM, poswald wrote: I have a concern regarding this.. A few times I have tried to integrate django-floppyforms which takes a similar approach to what the html5 widgets offer (input types are specified by default) and it often causes pain. The reason is that while browsers say

Re: Django-nonrel patches

2011-12-08 Thread Jonas H.
On 12/08/2011 11:39 PM, Jacob Kaplan-Moss wrote: On Thu, Dec 8, 2011 at 3:31 PM, Jonas H.<jo...@lophus.org> wrote: 2.) I don't like wasting my time, so I won't write extensive documentation before the patch gets accepted I'm sorry, but that's just not how we do things aroun

Re: Django-nonrel patches

2011-12-08 Thread Jonas H.
On 12/07/2011 09:53 PM, Aymeric Augustin wrote: I just came across your patches while I was triaging the "unreviewed" queue. Unfortunately, I found it difficult to assess them, since they don't include tests or docs. Generally, all changes should come with tests. If you're adding new features

Django-nonrel patches

2011-12-03 Thread Jonas H.
Hello list! On Jacob's suggestion in this thread [1] back in April, I split the diff between Django trunk and Django-nonrel into logically separated patches. I uploaded most of them to the ticket tracker (a few things are still missing but these are the most important changes):

Re: Python 3 and you

2011-11-07 Thread Jonas H.
On 11/07/2011 12:00 PM, richard.prosser wrote: I may be willing to support this. I have 18 month's of Python experience (mostly 2.4) and I have been out of work for a long time due to illness, so a project like this may look good on my CV! I have never been involved in an OS project before,

Re: [NoSQL] Sub-object queries / refactoring JOIN syntax into model fields

2011-10-20 Thread Jonas H.
bump On 09/28/2011 12:52 AM, Jonas H. wrote: Hallöchen, some non-relational databases (e.g. MongoDB) have support for arbitrarily nested objects. To make queries that "reach" into these sub-objects, the Django-nonrel developers find it appealing to use JOIN syntax. For instance,

Re: ORM refactoring

2011-10-10 Thread Jonas H.
On 10/10/2011 04:59 PM, Anssi Kääriäinen wrote: In the perfect world you could have a SQLA backend, or qs.as_sqla() method. That would be neat, yes. QuerySet chaining could be hard to implement, though (or does SQLA have support for something like that?). But in my opinion this is another

Re:

2011-10-04 Thread Jonas H.
On 10/04/2011 05:51 PM, Ted Gruenloh wrote: The django online documentation mentions that the SQL equivalent for __icontains is something like: SELECT ... WHERE headline ILIKE '%Lennon%'; However, for postgresql - one of the dbs that actually supports ILIKE - I noticed __icontains was

Re: [NoSQL] Sub-object queries / refactoring JOIN syntax into model fields

2011-09-28 Thread Jonas H.
On 09/28/2011 11:47 AM, Florian Apolloner wrote: On Wednesday, September 28, 2011 12:52:51 AM UTC+2, jo...@lophus.org wrote: What's the core team's opinion on this topic -- is there any chance to Secondly, how could this be implemented? Did you search the mailing list about this topic at

[NoSQL] Sub-object queries / refactoring JOIN syntax into model fields

2011-09-27 Thread Jonas H.
Hallöchen, some non-relational databases (e.g. MongoDB) have support for arbitrarily nested objects. To make queries that "reach" into these sub-objects, the Django-nonrel developers find it appealing to use JOIN syntax. For instance, if you had this person in your database {'name':

Re: new feature idea: even and odd forloop iteration variables

2011-09-19 Thread Jonas H.
On 09/19/2011 12:58 PM, skazhy wrote: Hi all! I've been working with Django for a while now, but today I decided to make a first contribution to Django that would make templates less ugly by adding these two values to loop_dict (in django/template/ defaulttags.py): loop_dict['even'] = (i %2 ==

Re: RFC: "universal" view decorators

2011-09-16 Thread Jonas H.
On 09/15/2011 11:27 PM, Donald Stufft wrote: tl;dr; Using Mixins to add in functionality to a CBV makes way more sense then using a decorator which is essentially going to be doing the same thing as a mixing would, it just makes finding what is going on harder, makes customizing the decorator

Re: Fixture loading using bulk_create

2011-09-12 Thread Jonas H.
On 09/12/2011 12:15 AM, Anssi Kääriäinen wrote: The feature could be useful if there are users loading big fixture files regularly. Otherwise it complicates fixture loading for little gain. Maybe we could simply add an option to the loaddata command -- so that if someone really needs tons of

Re: Proposal for a new templatetag definition syntax

2011-09-12 Thread Jonas H.
On 09/12/2011 11:49 AM, Cal Leeming [Simplicity Media Ltd] wrote: I may have misunderstood this thread slightly but, should templatetags follow the same structure as *args, **kwargs?? i.e. *args {% create_title "hello world" 800 800 %} **kwargs {% create_title title="helloworld" width=800

Re: Proposal for a new templatetag definition syntax

2011-09-12 Thread Jonas H.
On 09/12/2011 10:47 AM, lucky wrote: Hello, Alex, I agree with Wim Feijen. The ability to implement a arbitrary syntax for tag parameters is too abstract problem and this causes an increase in the complexity of the solution. Tag delelopers are forced to define a grammar and deal with lexing and

Fixture loading using bulk_create

2011-09-10 Thread Jonas H.
I started hacking the loaddata command to make use of the shiny new `bulk_create` code -- however, it seems that fixture loading (at least in its current incarnation) is incompatible to bulk inserts, for this reasons: 1. It's possible to have model objects overridden by fixtures. e.g. in

Re: Suppressed template errors in admin

2011-08-24 Thread Jonas H.
On 08/24/2011 05:44 PM, Ole Laursen wrote: Hi! I have a project where setting TEMPLATE_STRING_IF_INVALID has been invaluable in finding problems (for various reasons). The caveat mentioned in the docs don't kick in here because no templates are inherited from elsewhere. Except the admin which

Re: Consistent exception handling in templates.

2011-07-08 Thread Jonas H.
On 07/08/2011 05:24 PM, Jonathan Slenders wrote: My feeling is that we should silence TypeError, AttributeError and KeyError in _resolve_lookup, but only when they occur one frame deep. I agree with what you propose but AFAIK it's not easy to solve without doing frame analysis (I'd say that

Re: Form Rendering API Proposal

2011-06-23 Thread Jonas H.
On 06/23/2011 02:11 PM, Harro wrote: - Will the as_* methods on forms be deprecated? They seem to be a nice shorter version then the new way to do it. I'd rather provide a shorter version of {% form %} for built-in layouts: {% form foobar 'table' %} as shorthand for {% form foobar

Re: Reshaping the "Contributing to Django" documentation

2011-05-20 Thread Jonas H.
"[...] try and duplicate it. If you can duplicate it [...]" I'd stick with "reproduce" here because "duplicate" may be confused with "duplicate tickets". -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email

Re: Test optimizations (2-5x as fast)

2011-05-17 Thread Jonas H.
On 05/17/2011 04:48 PM, Jeremy Dunck wrote: 1) Use file modification timestamps for all model and test related files. Advantages: simple, works. Disadvantages: Triggers cache invalidation for changes not related to models or tests I think this is a pretty big win, even though it's not

Re: Test optimizations (2-5x as fast)

2011-05-17 Thread Jonas H.
On 05/17/2011 01:55 PM, Ned Batchelder wrote: On 5/16/2011 11:18 PM, Erik Rose wrote: How about caching the test databases? The database state could be cached after model setup (which takes some time if you've got lots of them) + initial data fixture setup, and after the setup for each test

Re: Test optimizations (2-5x as fast)

2011-05-14 Thread Jonas H.
On 05/14/2011 04:26 PM, Jonas H. wrote: I believe there's no generalized way of creating databases in Django now, so that would have to be added. s/creating/copying/ -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to

Re: Test optimizations (2-5x as fast)

2011-05-14 Thread Jonas H.
How about caching the test databases? The database state could be cached after model setup (which takes some time if you've got lots of them) + initial data fixture setup, and after the setup for each test case (fixtures + setUp() method). So, in the best case, no database setup is required

Re: Field lookup types and backwards incompatibility

2011-05-11 Thread Jonas H.
On 05/11/2011 03:17 AM, Chris Beaven wrote: 3. Change lookups to be uppercase (start the process of deprecating the current lowercase ones) uagh, .filter(foo_CONTAINS=bar)? -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to

Re: NoSQL support

2011-04-28 Thread Jonas H.
On 04/28/2011 08:59 AM, Russell Keith-Magee wrote: To be completely frank, from my perspective, the code is an unknown quantity at this point. It *might* be fine -- but it might not, on anything from a scale from "needs minor work" to "needs to be rebuilt". I simply don't know, and any process

Re: [5-for-1] Review request

2011-04-25 Thread Jonas H.
On 04/25/2011 05:33 PM, Jacob Kaplan-Moss wrote: On Mon, Apr 25, 2011 at 10:28 AM, Jonas H.<jo...@lophus.org> wrote: I'd like you to look into http://code.djangoproject.com/ticket/15696. Done. Unfortunately, the result's probably not what you wanted. If you'd like to re-use your

[5-for-1] Review request

2011-04-25 Thread Jonas H.
Here's what I reviewed: http://code.djangoproject.com/ticket/15783 http://code.djangoproject.com/ticket/15774 http://code.djangoproject.com/ticket/15801 http://code.djangoproject.com/ticket/15896 http://code.djangoproject.com/ticket/15895 I'd like you to look into

Re: Right way to do formfield-less fields?

2011-04-19 Thread Jonas H.
On 04/10/2011 03:14 PM, Jonas H. wrote: Hello! What's the preferred way to do a custom model field that has no corresponding formfield? Intuitively, I'd say raise a NotImplementedError, but that would make the whole model unusable in the admin even if that field is excluded from being displayed

Re: Right way to do formfield-less fields?

2011-04-10 Thread Jonas H.
On 04/10/2011 03:51 PM, Karen Tracey wrote: Please ask questions about using Django on django-users. This list is for discussing the development of Django itself. Karen, thanks for the hint, but I'm perfectly aware of that. Actually, this *is* a question about developing Django. -- You

Right way to do formfield-less fields?

2011-04-10 Thread Jonas H.
Hello! What's the preferred way to do a custom model field that has no corresponding formfield? Intuitively, I'd say raise a NotImplementedError, but that would make the whole model unusable in the admin even if that field is excluded from being displayed. That's because excluding a field

Re: Forms Parent ,Sibling reference

2011-01-10 Thread Jonas H.
On 01/10/2011 06:39 PM, Daniel Corbe wrote: Hi, How to get reference of one field form from another field form when both are in same form? wrong list, head over to django-users -- Jonas -- You received this message because you are subscribed to the Google Groups "Django developers"

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

2011-01-07 Thread Jonas H.
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 overhead of using an external file, when someone has to repeat small parts of code in a

Re: Need help w/ sql.where.WhereNode tree

2010-12-13 Thread Jonas H.
On 12/03/2010 03:06 PM, Jonas H. wrote: On 12/03/2010 10:04 AM, Waldemar Kornewald wrote: You probably don't want to use those aliases. Instead, you should use a separate alias namespace for embedded object filters. Otherwise you'll have to deal with the complex JOIN code in the backend

Purpose of constant_time_compare?

2010-12-08 Thread Jonas H.
Hello out there, what is the point of `django.utils.crypto.constant_time_compare`? I understand it takes O(n) time no matter what input it is feeded with, but of what avail is it? Can the time spent in *one single string comparison* really make such a huge difference? Confused, Jonas --

Re: Need help w/ sql.where.WhereNode tree

2010-12-03 Thread Jonas H.
On 12/03/2010 10:04 AM, Waldemar Kornewald wrote: You probably don't want to use those aliases. Instead, you should use a separate alias namespace for embedded object filters. Otherwise you'll have to deal with the complex JOIN code in the backend unnecessary. Aliases for embedded objects could

Re: DatabaseError swallowed?

2010-12-02 Thread Jonas H.
On 12/02/2010 04:27 PM, Dan Fairs wrote: I was wondering whether the bug still exists in Python 2.x because I take it only AttributeError and TypeError should be ignored while calling __len__ in list() -- if that's the case, the bug is definitely still present. True - I'll give it a try in

Re: Need help w/ sql.where.WhereNode tree

2010-12-02 Thread Jonas H.
On 12/01/2010 08:04 AM, Waldemar Kornewald wrote: In the end JOINs will be a rather complicated solution. I thought that's why you wanted to extend the ORM directly to handle embedded fields in a special way. That should be easier and cleaner. That's what I'm up to, but I have to know how to

Re: DatabaseError swallowed?

2010-12-02 Thread Jonas H.
Hi Dan, On 12/02/2010 03:43 PM, Dan Fairs wrote: My gut feeling is that this boils down to this vastly simplified demonstration of how list() works: class Foo(object): ... def __len__(self): ... print 'len called' ... raise ValueError ... def __iter__(self): ... return

Need help w/ sql.where.WhereNode tree

2010-11-30 Thread Jonas H.
Hello List! I'm working on queries on embedded objects for Django-nonrel (more precisely, djangotoolbox) that will use JOIN-like syntax. For this, I need to know how to distinguish .filter(spam__op=eggs, foo__op=bar) from .filter(spam__op=eggs).filter(foo__op=bar) in the .where tree used

Re: Non-SQL database cache backend

2010-11-01 Thread Jonas H.
On 11/02/2010 01:09 AM, Russell Keith-Magee wrote: - The base class refactoring makes sense, although what you're proposing isn't really just a 'BaseDB backend', but a 'backend that has to implement culling'. The reason I can say this is that the logic you have factored out is duplicated in

Re: Non-SQL database cache backend

2010-11-01 Thread Jonas H.
On 10/29/2010 03:37 PM, Russell Keith-Magee wrote: Writing a MongoDB (or any other non-SQL) cache backend shouldn't be a particularly onerous task; after all, the queries are simple, and the .The SQL backend is only 150 lines of code; a backend for any noSQL backend should run to about the same

Non-SQL database cache backend

2010-10-29 Thread Jonas H.
Hi folks, upon the recommendation on the django-nonrel mailing list, I'll re-post my original question here: -- Begin original message -- I just tried to use MongoDB as cache backend (only for development ;-) but it failed because apparently the Django guys do hand-written SQL in the