Re: Having a MongoDB connector for Django

2017-09-18 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Fri, Sep 15, 2017 at 6:44 PM, Nes Dis wrote: > I would like to thank everyone for their valuable comments. Simultaneously I > would like to comment on some conceptions regarding using MongoDB. Its not > accurate to state that relational joins cannot happen in MongoDB. It can be > done at the ap

Re: Having a MongoDB connector for Django

2017-09-08 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
Short answer: always use the appropriate tool Relational databases and document stores have different uses and purposes. Using a document store like a relational database (eg, with an ORM (emphasis on the R)) is a bad idea, and using a relational database as a document store is similarly foolish.

Re: Automatic prefetching in querysets

2017-08-16 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
Is this opt-{in,out} considered to be a global flag, meant to be toggled on or off depending on whether it is an "expert" working on the project or not? I don't think that would be a good idea, almost all of our projects have a mix of skill levels, and people move from team to team on a regular ba

Re: Time based one time password and django ?

2017-01-17 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
Also django-two-factor, which builds on django-otp and provides all extra bits you might need, eg setup views, QR code generation for device registration, login wizards etc supporting HOTP/TOTP, static tokens, Yubikey and SMS. https://markusholtermann.eu/2016/09/2-factor-authentication-in-django/

Re: Django 2.0 Python version support (Python 3.6+ only?)

2017-01-06 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Thu, Jan 5, 2017 at 8:10 PM, Asif Saifuddin wrote: > Hi, > > django 2.0 will be released in december 2017 and ubuntu 18.04 will be > released in april 2018 which will default atleast 3.6, so I think this > should also be taken as consideration while deciding. I know supporting endless versions

Re: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-23 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Sat, Nov 19, 2016 at 1:01 AM, Florian Apolloner wrote: > On Thursday, November 17, 2016 at 5:07:07 PM UTC+1, Tom Evans wrote: >> >> Or: >> from socket import gethostname, gethostbyname >> ALLOWED_HOSTS = [ gethostname(), gethostbyname(gethostname()), ] > >

Re: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-17 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Wed, Nov 16, 2016 at 10:29 PM, Thomas Turner wrote: > Hi > > The other day I raise a ticket to do with ALLOWED_HOSTS and it was suggested > that I post on this group before creating a patch > The ticket is https://code.djangoproject.com/ticket/27485 > > The problem > > Now that Django 1.10.3 fo

Re: Adding an some warnings, checks, or exceptions for urls

2016-04-25 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Mon, Apr 25, 2016 at 1:00 PM, Robert Roskam wrote: > I realize this is a really, really obvious and easily fixed newbie error. > But here it is: > > urlpatterns = [ > url(r'^sitemap/', > TemplateView.as_view(template_name='brochure/sitemap.html'), > name="sitemap"), > # More urls > ] >

Re: Provide a way to pass kwargs when initializing the storage class

2015-11-07 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Sat, Nov 7, 2015 at 11:58 AM, Raphaël Barrois wrote: > Hello, > > > The core of the proposed solution seems quite interesting; however, it also > introduces a new configuration format for backends. > > Caches and databases use a dict with a "BACKEND" key and an "OPTIONS" dict > for kwargs to

Re: #25582: Add a way to build URLs with query strings

2015-10-23 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Fri, Oct 23, 2015 at 12:59 PM, guettli wrote: > API proposal: > > Add a new kwarg to reverse(): > >reverse(..., get=None) > > > Example: reverse('my_view_name', kwargs={'pk': '1'}, get=dict(param='value') Would 'get' be a dict or a querydict? (URL parameters can be repeated, dict keys cann

Re: Making max_length argument optional

2015-09-22 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Tue, Sep 22, 2015 at 1:49 AM, Podrigal, Aron wrote: > Different schemas?? Schema will always be different for each database > backend according to its datatypes. I really don't understand what your > concern is. In any case your free to specify a max_length=N where it will be > the same for all

Re: Making max_length argument optional

2015-09-21 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Mon, Sep 21, 2015 at 5:21 PM, Paulo Maciel wrote: > +1 max_length optional > I'm slightly worried from a DB point of view. Whilst blessed PostgreSQL supports variable length fields seemingly without issues, other DB engines (MySQL, for instance), have significant performance issues using a TEX

Re: Get current user in model signal pre_save

2015-09-09 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Wed, Sep 9, 2015 at 4:11 PM, Xavier Palacín Ayuso wrote: > I want to collects current user in model signal pre_save, to prevent remove > super user permission to current super users. Hi Xavier. This mailing list is for discussing the development of django itself, not for discussing how to deve

Re: request for API review of streaming responses additions

2015-09-07 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Mon, Sep 7, 2015 at 3:04 PM, Aymeric Augustin wrote: > 2015-09-07 10:00 GMT+02:00 Yann Fouillat : >> I agree, do you know what tools could I use to emulate 3G ? > > As far as I know, the canonical tools are: > > - on Linux, netem: > http://www.linuxfoundation.org/collaborate/workgroups/networki

Re: Feature: Support a javascript template language on the server

2015-06-01 Thread Tom Evans
On Sat, May 30, 2015 at 5:52 PM, Emil Stenström wrote: > Hi, > > This is the second feature proposal as part of my general drive for getting > Django to work better for javascript heavy sites. > > Support a javascript template language on the server > --

Re: An easier path to upgrade from one LTS release to another

2015-05-07 Thread Tom Evans
On Thu, May 7, 2015 at 9:04 AM, Abdullah Esmail wrote: > Hello, > I apologize if this has been discussed already. I searched the topics, but > didn't find anything. > First, I'd like to thank all of you for the truly amazing framework. I've > been using django since 1.0 and it made my life much mo

Re: Pass exception to error handlers

2015-04-22 Thread Tom Evans
On Wed, Apr 22, 2015 at 3:05 PM, Tim Graham wrote: > I have some concerns from a security standpoint. For example, some exception > messages are definitely not meant to be displayed to end users and may leak > server implementation details. For example: This is saying you can't have a gun because

Re: Two phase cleaning of models/forms

2015-04-02 Thread Tom Evans
On Wed, Mar 25, 2015 at 9:37 AM, Thomas Güttler wrote: > Up to now the validation/cleaning of a attribute can not access the > value of an other attribute. > > The work around is to override the clean() method of the form/model. > > A team mate and I talked about it, and we asked ourself, if > a t

Re: A general way to batch SQL queries in Django

2015-02-27 Thread Tom Evans
On Fri, Feb 27, 2015 at 3:19 PM, aRkadeFR wrote: > What do you mean by a single roundtrip? He means asking the database server to consider multiple queries (concurrently?), and return data once all of them are available. In pseudo code: people, jobs, cities = DB.fetch_multi( Pers

Re: Testing email settings

2015-02-27 Thread Tom Evans
On Fri, Feb 27, 2015 at 9:01 AM, aRkadeFR wrote: > Hello, > > I've written couple of time similar command for my project too. > > But if I take a step back, these commands (for my projects) are > only here to test that my SMTP settings are well setup. Thus, > the test sending email is quite unnece

Re: Settings: lists or tuples?

2015-02-19 Thread Tom Evans
On Thu, Jan 22, 2015 at 12:32 PM, Andreas Kahnert wrote: > Hi again, > Well, I can acknoledge that your reasons for list (beginner friendly) are as > good as my reasons for tuples (seems to be more logical choice for things > that are static). To say it in other words, my idea was simply: Use tupl

Re: Proposal of new feature: handler to HttpResponseNotAllowed (status 405)

2014-10-07 Thread Tom Evans
On Fri, Oct 3, 2014 at 10:17 PM, Poorbahrdew .poorbahrdew wrote: > Hi guys, > > I know, this is a quite old thread, but recently I had the same issue with > these decorators for the same reason: how to handle 405 responses in user > friendly way? > > I have found a simple solution which doesn't re

Re: Please don't kill the ecosystem

2014-09-03 Thread Tom Evans
On Tue, Sep 2, 2014 at 2:53 PM, Aymeric Augustin wrote: > 2014-09-02 15:33 GMT+02:00 Tom Evans : > >> this story was scored >> at 8 points, it took a junior developer much longer than 8 points and >> wasn't finished in a single sprint - and 1.3->1.4 was *easy* >

Re: Please don't kill the ecosystem

2014-09-02 Thread Tom Evans
On Mon, Sep 1, 2014 at 9:45 PM, Pkl wrote: > > Hello, > > I once was once lured to an ideal of long-term stability and > retrocompatibility, by nice docs like this one : > https://docs.djangoproject.com/en/dev/misc/api-stability/ > > But for some years, stuffs have actually been getting worse and

Re: Improvement to objects.get_or_create and objects.update_or_create

2014-08-28 Thread Tom Evans
On Wed, Aug 27, 2014 at 10:19 PM, Benjamin Scherrey wrote: > I don't believe the functionality is backwards incompatible at all unless > I'm missing something. The new behavior of automatically selecting the > optimal search field (prioritized by pk first then by any discovered field > marked as u

Re: The low down on the "Unsettings" project

2014-06-22 Thread Tom Evans
Google "django-development unsettings". It's been discussed at length on list. Cheers Tom On Fri, Jun 20, 2014 at 8:06 PM, Andy Baker wrote: > This sounds really interesting. Is there anything about this in writing? I'm > not a fan of listening to audio on tech subjects (must... skim... read...

Re: Terms for database replication

2014-06-05 Thread Tom Evans
On Thu, Jun 5, 2014 at 8:07 PM, Justin Holmes wrote: > OK. How about "canon" and "replica" ? I think we all get sent to the naughty step if we continue to discuss this, so I will just say that "master" is being used as an adjective in this context, it is the master database, or the master connec

Re: Terms for database replication

2014-06-05 Thread Tom Evans
On Thu, Jun 5, 2014 at 5:08 PM, Justin Holmes wrote: > I don't want to devolve completely into an etymological circlejerk here, but > my sense is that "master" in the VCS sense is like "master key," rather than > describing the interpersonal relationship of involuntary servitude. > And in databas

Terms for database replication

2014-06-05 Thread Tom Evans
Please revert this change as soon as possible. If the project has become so PC sensitive that the word "slave" is no longer permitted to be uttered, then "replica" is an alternate term, but "primary" is not. Have you ever set up "primary-primary replication"? No, neither have I. Master-master rep

Re: Why not Single Table Inheritance?

2014-05-15 Thread Tom Evans
On Thu, May 15, 2014 at 4:11 PM, Christian Schmitt wrote: > This is already merged. > > https://docs.djangoproject.com/en/1.6/topics/db/models/#multi-table-inheritance > MTI is not STI, nor is it polymorphic. Cheers Tom -- You received this message because you are subscribed to the Google Gro

Re: Proposal: update_fields shortcut

2014-03-05 Thread Tom Evans
On Wed, Mar 5, 2014 at 2:05 PM, Paulo Poiati wrote: > Hello everyone, > > While developing standard web applications one thing I frequently do is > updating just one field of a model instance and save it after that. The best > way to do that today (if you want to avoid the update in all the fields

Re: GSOC 2014 Project Proposal

2014-02-24 Thread Tom Evans
On Sat, Feb 22, 2014 at 5:31 PM, Devashish Badlani wrote: > Sir, > > > Sample projects with the updated Django 1.6.2,use of latest modules in each > of them and an helpful documentaion ,would certainly enhance the value of > DjangoBook is what I feel > How would this work? The book currently admo

Re: Django ORM support for NoSql databases

2013-12-17 Thread Tom Evans
On Tue, Dec 17, 2013 at 4:50 PM, Chris Wilson wrote: > Hi all, > > > On Tue, 17 Dec 2013, Tom Evans wrote: > >> On Tue, Dec 17, 2013 at 3:35 PM, parisrocks >> wrote: >>> >>> Waiting for official Django ORM support for NoSql databases. >> >

Re: Django ORM support for NoSql databases

2013-12-17 Thread Tom Evans
On Tue, Dec 17, 2013 at 3:35 PM, parisrocks wrote: > Hi Django Users, > I tried Django recently and really liked the simplistic approach for > building sites. > But there's no official support for NoSQL databases like Cassandra or > MongoDB, there's a great community of NoSQL users waiting for an

Re: mod_python support

2013-11-25 Thread Tom Evans
On Mon, Nov 25, 2013 at 5:09 PM, Ramiro Morales wrote: > Now that specs like WSGI exist there is no point in going back one decade > implementing interfaces to cater for one particular web server integration > implementation. Is that any worse than where we are now, using an interface that only a

Re: Add strutctured settings module to django 1.7?

2013-10-02 Thread Tom Evans
On Tue, Oct 1, 2013 at 6:42 PM, Tino de Bruijn wrote: > To all of you who don't see benefit in putting certain (definitely not all!) > settings in the environment, I would like to say: try it. It will finally > make sense that you set DJANGO_SETTINGS_MODULE in the first place. I never > understood

Re: Add strutctured settings module to django 1.7?

2013-09-27 Thread Tom Evans
On Thu, Sep 26, 2013 at 2:21 PM, Andres Osinski wrote: > Honestly, I find the idea of *not* using a settings file to be inconvenient, > and the notion of using environment variables for doing anything aside from > pointing to a settings file to be pretty disgusting. +1 The idea that before you s

Re: get_cache and multiple caches

2013-09-24 Thread Tom Evans
On Mon, Sep 23, 2013 at 5:55 AM, Anssi Kääriäinen wrote: > On 09/20/2013 06:29 PM, Tom Evans wrote: >> >> On Fri, Sep 20, 2013 at 4:13 PM, Florian Apolloner >> wrote: >>>> >>>> It seems more sensible to hook something that has the lifetime of the >

Re: get_cache and multiple caches

2013-09-20 Thread Tom Evans
On Fri, Sep 20, 2013 at 4:13 PM, Florian Apolloner wrote: >> It seems more sensible to hook something that has the lifetime of the >> request to the request, rather than stick it in TLS, keyed to the >> thread serving the request. > > > Jupp, sadly I don't see a sensible way around thread local st

Re: get_cache and multiple caches

2013-09-20 Thread Tom Evans
On Fri, Sep 20, 2013 at 3:10 PM, Florian Apolloner wrote: > The main issue here isn't recreating the objects on demand, but the impact > they have, eg a new memcached connection. Now imagine a complex system where > each part issues get_cache('something') to get the cache On the other hand each c

Re: get_cache and multiple caches

2013-09-20 Thread Tom Evans
On Wed, Sep 18, 2013 at 12:29 PM, Curtis Maloney wrote: > I started working on a CacheManager for dealing with thread local cache > instances, as was suggested on IRC by more than one person. > The problem that Florian identified was that recreating cache instances each time get_cache() was calle

Re: Support Negative Indexing on QuerySets

2013-08-01 Thread Tom Evans
On Thu, Aug 1, 2013 at 10:44 AM, Loic Bistuer wrote: > On Aug 1, 2013, at 4:05 PM, Tom Evans wrote: > >> qs = ... >> print len(qs) >> print qs[0] >> print qs[-1] >> print qs[0] >> >> How many queries for this? > > Just one and "qs[-1]&

Re: Support Negative Indexing on QuerySets

2013-08-01 Thread Tom Evans
On Wed, Jul 31, 2013 at 7:39 PM, Loic Bistuer wrote: > In your example "print qs[0]" evaluates a *clone* of "qs", not "qs" itself. > > Therefore "qs[0]; qs[-1]; qs[0]" triggers 3 queries, just like "qs[0]; qs[0]; > qs[0]" would. > Fine, be pedantic: qs = ... print len(qs) print qs[0] print qs[0

Re: Support Negative Indexing on QuerySets

2013-07-31 Thread Tom Evans
On Tue, Jul 30, 2013 at 11:04 PM, Wim Lewis wrote: > > On 30 Jul 2013, at 2:06 PM, Florian Apolloner wrote: >> How do you think such support would look like? For negative indices you'd >> have to know the size of the resultset to be able to do "limit somthing >> offset length-your_negative_index

Re: Deprecate FCGI support in Django 1.7

2013-07-24 Thread Tom Evans
On Sun, Jul 21, 2013 at 8:28 AM, Some Developer wrote: > On 21/07/2013 05:08, Curtis Maloney wrote: >> >> I wasn't aware there was a particular performance issue, but I'll >> certainly keep it in mind. > > > Take a look at this: > > http://www.peterbe.com/plog/fcgi-vs-gunicorn-vs-uwsgi > > I've pr

Re: Proposal of new feature: handler to HttpResponseNotAllowed (status 405)

2013-07-09 Thread Tom Evans
On Mon, Jul 8, 2013 at 10:01 AM, Jorge C. Leitão wrote: > Django allows users to define handlers to some exceptions, most notably > http404, server error (status 500) and permission denied (status 403). > In fact, django already allows you to install handlers to process any kind of unhandled exce

Re: Perception of attitude in tickets

2013-05-13 Thread Tom Evans
On Mon, May 13, 2013 at 4:10 PM, Jacob Kaplan-Moss wrote: > Hi Tom -- > > It really sucks that when I say "if you have feedback please send it > over here", you hear "I'm not listening". > > I'm sorry, but I don't have the mental bandwidth to follow 20,000 > individual tickets. It's impossible. I

Re: Perception of attitude in tickets

2013-05-13 Thread Tom Evans
On Mon, May 13, 2013 at 3:51 AM, Russell Keith-Magee wrote: > My apologies if I wasn't clear - that wasn't what I was saying at all. What > I meant is that we can't institute a process like "Every core developer must > spend 4 hours per week triaging tickets or they will lose their core > develope

Re: [GSoC 2013] Revamping validation functionality proposal

2013-04-26 Thread Tom Evans
On Fri, Apr 26, 2013 at 8:54 AM, Christopher Medrela wrote: > Thank you for your feedback. I really appreciate every comment because that > let me improve my proposal. > > 1. First of all, I noticed that the license of django-secure is copyright. > Google forces us to release code under one of app

Re: Ticket 20147 - deprecate and replace request.META

2013-04-09 Thread Tom Evans
On Mon, Apr 8, 2013 at 9:02 PM, Luke Plant wrote: > Hi all, > > This is already the subject of a ticket, but I didn't get a response > yet. Basically, the idea is replace things like: > > request.META['HTTP_ACCEPT'] > > with > > request.HEADERS['Accept'] > > request.META should be deprecated a

Re: URL dispatcher fallthrough?

2013-03-19 Thread Tom Evans
On Mon, Mar 18, 2013 at 3:23 PM, julianb wrote: > Hi, > > imagine the following use case: > > You build an online store where you have sorted products into several > categories and maybe associated an occasion. Now you want to build URLs. So > the URL schema that all of the store's owners agree on

Re: Documenting lazy() and memoize()

2013-03-15 Thread Tom Evans
On Mon, Mar 11, 2013 at 2:50 PM, Tom Evans wrote: > Hi all > > Someone just asked on users@ "How do I reverse a URL inside > settings.py". I gave a solution (eventually; got it wrong the first > time!) using two functions from django.utils.functional, lazy() and > mem

Documenting lazy() and memoize()

2013-03-11 Thread Tom Evans
Hi all Someone just asked on users@ "How do I reverse a URL inside settings.py". I gave a solution (eventually; got it wrong the first time!) using two functions from django.utils.functional, lazy() and memoize(). Neither of these two functions are documented. and so aren't part of the API - real

Re: postgresql range types v2

2013-01-18 Thread Tom Evans
On Thu, Jan 17, 2013 at 10:08 PM, Russell Keith-Magee wrote: > The other thing I'd suggest is to look at others doing similar work. For > example, Zachary Voase has been working on extensions to Django's PostgreSQL > backend to support a whole lot of extra PostgreSQL features[1]. From the > look o

Re: Django 1.1 is not installable

2012-12-18 Thread Tom Evans
On Wed, Dec 12, 2012 at 3:56 PM, Michael Elsdörfer wrote: > $ pip install django==1.1 If you mean "The most recent point release in the 1.1 family", then that is "Django>1.1,<1.2"*. If you mean 1.1.1, then that is "Django==1.1.1" Cheers Tom * If you are using pypi, then "Django<1.2" will do th

Re: [ANNOUNCE] Security releases (Django 1.3.5, Django 1.4.3, Django 1.5 beta 2)

2012-12-11 Thread Tom Evans
On Mon, Dec 10, 2012 at 10:38 PM, James Bennett wrote: > Django 1.3.5, Django 1.4.3 and Django 1.5 beta 2 have just been issued > in response to security issues. > > Details are available here: > > https://www.djangoproject.com/weblog/2012/dec/10/security/ > Is the second part of the fix in any w

Re: Yet another __ne not equal discussion

2012-11-30 Thread Tom Evans
On Fri, Nov 30, 2012 at 2:51 PM, Marek Brzóska wrote: > > > > 2012/11/30 Tom Evans >> >> On Fri, Nov 30, 2012 at 1:29 PM, Marek Brzóska >> wrote: >> > Has the matter been completely put away? >> > >> > I would like to bring it up ag

Re: Yet another __ne not equal discussion

2012-11-30 Thread Tom Evans
On Fri, Nov 30, 2012 at 1:29 PM, Marek Brzóska wrote: > Has the matter been completely put away? > > I would like to bring it up again. > > I have Articles and Categories. An Article belongs to Categories: > > class Category(model): > pass > class Article(model): > category = ManyToManyField(C

Re: Django and South

2012-11-20 Thread Tom Evans
On Tue, Nov 20, 2012 at 4:29 AM, Лебедев Илья wrote: > I've realized that django has no migration tool in development and that > looks weird for me. Everybody use South, but django neither includes it in > contrib nor uses it in development. > What's the big deal? Can someone please explain. http

Re: Feature Request: Support for abstract models in ModelForm

2012-11-14 Thread Tom Evans
On Tue, Nov 13, 2012 at 7:04 PM, Rohit Banga wrote: > I have some abstract models and I have created several concrete > implementations of each of these models. The usecase is create multiple sets > of tables across each having the same set of fields. When I use abstract > models for modelforms it

Re: A.objects.getdefault

2012-10-15 Thread Tom Evans
On Mon, Oct 15, 2012 at 1:42 PM, Anssi Kääriäinen wrote: > On 10/15/2012 03:13 PM, Ole Laursen wrote: > > On Friday, October 12, 2012 3:35:53 PM UTC+2, Chris Wilson wrote: >> >> I'm strongly in favour of a simple, obvious way to do the common thing, >> which is to return None if the object doesn't

Re: URL dispatcher slow?

2012-10-12 Thread Tom Evans
On Thu, Oct 11, 2012 at 10:58 PM, Łukasz Rekucki wrote: > On 11 October 2012 10:20, Russell Keith-Magee wrote: >> >> And don't just say "Why are Django's URL resolvers slow?". Do some >> profiling, and come back with an analysis of where the time is being >> spent and/or wasted. > > FWIW, here's

Re: URL dispatcher slow?

2012-10-12 Thread Tom Evans
On Thu, Oct 11, 2012 at 2:53 PM, Tom Evans wrote: > On Wed, Oct 10, 2012 at 7:52 AM, Moonlight wrote: >> Here is an article comparing various URL dispatchers: >> >> http://mindref.blogspot.com/2012/10/python-web-routing-benchmark.html >> >> What cause django

Re: URL dispatcher slow?

2012-10-11 Thread Tom Evans
On Wed, Oct 10, 2012 at 7:52 AM, Moonlight wrote: > Here is an article comparing various URL dispatchers: > > http://mindref.blogspot.com/2012/10/python-web-routing-benchmark.html > > What cause django URL dispatcher that much... slow? > Now that I've looked in detail at the test, it is because t

Re: URL dispatcher slow?

2012-10-11 Thread Tom Evans
On Thu, Oct 11, 2012 at 7:02 AM, Yo-Yo Ma wrote: > Why does every conversation about Django's performance met with "GTFO we > don't care"? (that was a rhetorical question :). I'd venture to guess that > most "It's fast enough for me!" responses are predicated on experiences that > can be likene

Re: Possible session key creation regression in 1.4

2012-05-18 Thread Tom Evans
On Fri, May 18, 2012 at 1:38 PM, Aymeric Augustin wrote: > Le 18 mai 2012 à 11:51, Tom Evans a écrit : > >> On Wed, May 16, 2012 at 4:38 PM, Aymeric Augustin >> wrote: >>> 2012/5/16 Tom Evans : >>>> So, is the session key being available part of the API

Re: Possible session key creation regression in 1.4

2012-05-18 Thread Tom Evans
On Fri, May 18, 2012 at 10:51 AM, Tom Evans wrote: > On Wed, May 16, 2012 at 4:38 PM, Aymeric Augustin > wrote: >> 2012/5/16 Tom Evans : >>> So, is the session key being available part of the API, or is relying >>> on the session key existing incorrect? >> &g

Re: Possible session key creation regression in 1.4

2012-05-18 Thread Tom Evans
On Wed, May 16, 2012 at 4:38 PM, Aymeric Augustin wrote: > 2012/5/16 Tom Evans : >> So, is the session key being available part of the API, or is relying >> on the session key existing incorrect? > > Hi Tom, > > Accessing the session key before saving the session is

Re: Exception Middleware not run [was Re: Subclass handle_uncaught_exception]

2012-05-17 Thread Tom Evans
On Thu, May 17, 2012 at 9:51 AM, rorycl wrote: > Hi Tom > > Thanks for your email. > > On May 16, 4:14 pm, Tom Evans wrote: >> On Wed, May 16, 2012 at 12:32 PM, Rory Campbell-Lange >> >> wrote: > >> > I have a view raising a specific except

Re: Possible session key creation regression in 1.4

2012-05-16 Thread Tom Evans
On Wed, May 16, 2012 at 4:38 PM, Aymeric Augustin wrote: > 2012/5/16 Tom Evans : >> So, is the session key being available part of the API, or is relying >> on the session key existing incorrect? > > Hi Tom, > > Accessing the session key before saving the session is in

Re: Exception Middleware not run [was Re: Subclass handle_uncaught_exception]

2012-05-16 Thread Tom Evans
On Wed, May 16, 2012 at 12:32 PM, Rory Campbell-Lange wrote: > I'm obviously whistling in the breeze here, but I'd be very grateful for > some help. I've provided some more info below. > > I have a view raising a specific exception I would like to catch and > provide an HttpResponse based on this

Possible session key creation regression in 1.4

2012-05-16 Thread Tom Evans
Hi all One of our sites was recently upgraded to 1.4 and now some previously working code is failing. The code tries to access and utilize the session id from the user, but if it tries to do this on the request the session is created on, the session id is None. The equivalent session object in 1.

Re: Will django escaping ever consider context of javascript and CSS?

2012-05-03 Thread Tom Evans
On Fri, Apr 27, 2012 at 11:58 PM, Voulnet wrote: > Hello provides great protection from XSS by escaping output to > webpages, but it only does it in HTML context. XSS can be executed > when user input is inserted into javascript or CSS, which have > different context and rules than HTML, so HTML c

Re: Allowing formsets to contribute kwargs to forms they create

2012-04-24 Thread Tom Evans
On Tue, Apr 24, 2012 at 3:23 PM, Andrew Ingram wrote: > I've had the need for this quite frequently, Whenever I'm using a > custom form class with modelformset_factory I almost always end up > having to define a custom formset class that does nothing except pass > an extra kwargs (usually user) to

Allowing formsets to contribute kwargs to forms they create

2012-04-24 Thread Tom Evans
Hi all I raised a ticket about this new feature, with patch: https://code.djangoproject.com/ticket/18166 I'd quite like to quickly either complete this or dump the idea. Opinions? Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django developers" gr

Re: auth.user refactor: the profile aproach

2012-04-13 Thread Tom Evans
On Tue, Apr 10, 2012 at 6:04 PM, Alex Ogier wrote: > Hi Tom, > > The best rounded description with pros and cons is Solution 2a on > https://code.djangoproject.com/wiki/ContribAuthImprovements > > You are correct that I am primarily thinking of pluggable authentication > when I think of this new u

Re: auth.user refactor: the profile aproach

2012-04-10 Thread Tom Evans
On Tue, Apr 10, 2012 at 3:13 PM, Ian Lewis wrote: > Hi, > > I'm not getting why you *have* to add fields to the User model to store data > pertaining to the user. There is nothing in the proposal for pluggable user > models that says you can never have a seperate model with a foreign key to > the

Re: auth.user refactor: the profile aproach

2012-04-10 Thread Tom Evans
On Fri, Apr 6, 2012 at 7:31 PM, Alex Ogier wrote: > Tai, read https://gist.github.com/2289395 for a summary of many reasons why > I think profiles are a bad idea, and unifying multiple profiles is an even > worse idea. > > Best, > Alex Ogier Hi Alex Is https://gist.github.com/2289395 the complet

Re: Proposal: upgrading the choices machinery for Django

2012-04-05 Thread Tom Evans
2012/4/4 Łukasz Langa : > Wiadomość napisana przez Tom Evans w dniu 4 kwi 2012, o godz. 18:40: > >> The class definition grates. When we say things like: >> >>  class Gender(Choices): >>    male = Choice("male") >> >> That says to me that Gende

Re: Proposal: upgrading the choices machinery for Django

2012-04-04 Thread Tom Evans
2012/4/3 Łukasz Langa : > A nice HTML rendering of this proposal is available at: > http://lukasz.langa.pl/2/upgrading-choices-machinery-django/ Disclaimer: all my code currently looks like 'Way 3'. In general, I like it. There are a few things I don't like in it: The class definition grates. Wh

Re: [GSoC 2012] Enhanced contrib.auth

2012-03-30 Thread Tom Evans
On Fri, Mar 30, 2012 at 10:39 AM, Stratos Moros wrote: > You can read the proposal nicely formatted here: > https://gist.github.com/8dd9fb27127b44d4e789 Hi Stratos It's a long proposal, so this is a brain dump of bits that I find interesting/worrisome. I'm sure you've followed the recent thread

Re: Tagging 1.4 django release in Subversion

2012-03-26 Thread Tom Evans
On Sun, Mar 25, 2012 at 12:02 PM, Florian Apolloner wrote: > Hi, > > it's not tagged yet on purpose. > > Cheers, > Florian > Out of interest, is there any documentation of the release process? I'm also intrigued how you have a release tarball before you have tagged the release! Cheers Tom --

Re: auth.User refactor: reboot

2012-03-20 Thread Tom Evans
On Tue, Mar 20, 2012 at 6:02 PM, Donald Stufft wrote: > So you fix the problem for the people who agree that username should be > longer, and that email > should be longer, but not the people who feel that email should be longer > but username is fine? > > Those settings do not feel any cleaner to

Re: auth.User refactor: reboot

2012-03-20 Thread Tom Evans
On Tue, Mar 20, 2012 at 5:41 PM, Donald Stufft wrote: > What Alex said. If it was _just_ the username then you'd have a good > argument for > a setting like that. However there's username, email, some people want to > add > fields, some want to get rid of, or combine fields. Ideally any change wou

Re: auth.User refactor: reboot

2012-03-20 Thread Tom Evans
On Tue, Mar 20, 2012 at 5:17 PM, Alex Ogier wrote: >> Would something like the following alleviate that problem? >> >> class User(models.Model): >>    if settings.USE_LONG_USER_FIELDS: >>        username = models.CharField(max_length=255, unique=True, ...) >>    else: >>        username = models.C

Re: auth.User refactor: reboot

2012-03-20 Thread Tom Evans
On Tue, Mar 20, 2012 at 1:37 PM, Russell Keith-Magee wrote: > > On 20/03/2012, at 8:38 PM, Tom Evans wrote: >> >>>  * It's completely backwards compatible. >>> >>> If you've got an existing app with normal ForeignKeys to auth.User, >>>

Re: auth.User refactor: reboot

2012-03-20 Thread Tom Evans
On Sat, Mar 17, 2012 at 5:59 AM, Russell Keith-Magee wrote: > Ok - I've been keeping quiet on this; partially due to the same tone issues > that you've described, but also because I don't have a huge amount of spare > time at the moment, and I don't want to be the person who makes a bunch of >

Re: auth.User refactor: reboot

2012-03-16 Thread Tom Evans
On Fri, Mar 16, 2012 at 4:53 PM, Jacob Kaplan-Moss wrote: > Hi folks -- > […] I'm not in favour of pluggable user models, as for me, they solve the wrong problem. A pluggable user model has to be set up by the project developer, whilst the attributes an app may need are specified solely by the ap

Re: authentication by email

2012-03-16 Thread Tom Evans
On Thu, Mar 15, 2012 at 4:49 PM, Carl Meyer wrote: > Hi Daniel, > > On 03/15/2012 09:24 AM, Daniel Sokolowski wrote: >> Why can we not just increase the length limit on the username field?, >> Why can't we just throw a validation error if data entered is to long >> and the schema has not been upda

Re: authentication by email

2012-03-09 Thread Tom Evans
2012/3/9 Łukasz Rekucki : > On 9 March 2012 17:46, Tom Evans wrote: >> >> Lets look at one isolated aspect. The User email field in d.c.auth is >> too short. Emails can be up to 248 characters long, and d.c.auth only >> allows 75. > > The latest RFC[1] actually sp

Re: authentication by email

2012-03-09 Thread Tom Evans
On Fri, Mar 9, 2012 at 3:52 PM, Luke Plant wrote: > On 09/03/12 14:49, Tom Evans wrote: > >>> Yes, since no one needs it. Okay no one isn't true, but no one (for true >>> this time) who needed it stepped up and said "I'll implement it and see that >&

Re: authentication by email

2012-03-09 Thread Tom Evans
On Fri, Mar 9, 2012 at 3:36 PM, Luke Plant wrote: > What you are really saying is this: being pragmatic means that we > prioritise *your* immediate need above the need to keep the code and the > docs maintainable, and above the need to maintain compatibility with > existing installations. > > Ther

Re: authentication by email

2012-03-09 Thread Tom Evans
On Fri, Mar 9, 2012 at 8:13 AM, Florian Apolloner wrote: >> Should these things really take five years? What happened to pragmatic? > > > Yes, since no one needs it. Okay no one isn't true, but no one (for true > this time) who needed it stepped up and said "I'll implement it and see that > it end

Re: Error while importing URLconf 'permitprint.urls': day is out of range for month

2012-02-29 Thread Tom Evans
On Wed, Feb 29, 2012 at 3:10 PM, furby wrote: > A site I built is breaking due to the leap year day, Feb. 29th.  The > error can be seen here: > > www.permitprint.com > > Any help resolving this would be appreciated.  I can't track down the > exception past the traceback. Do not post questions ab

Re: Revisiting multiline tags

2012-02-24 Thread Tom Evans
On Fri, Feb 24, 2012 at 3:12 PM, Alex Gaynor wrote: > Folks, you seem to have missed Russell's point.  Even if 100 people +1 this, > it's meaningless.  That's a tiny fraction of this mailing list's readership, > much less of the Django community at large.  Django is the way it is > because, first

Re: Newline stripping in templates: the dnl way

2012-02-24 Thread Tom Evans
On Fri, Feb 24, 2012 at 2:10 PM, Tobia wrote: > Hi all, > regarding issue #2594 "Template system should handle whitespace > better" explaining the need for some kind of (optional) whitespace > stripping from the output of templates, I've been looking at the > proposed solutions and compared them t

Improving docs for User.is_authenticated()

2012-02-23 Thread Tom Evans
Hi all I don't like this function that much. It doesn't actually check whether users are authenticated - which is to say, they have presented credentials which we have accepted and authorized them to use to the site. Instead it always returns true. is_not_anonymous_user() may be a better name. Us

Re: How to create a new command in django-admin.py

2012-02-23 Thread Tom Evans
On Thu, Feb 23, 2012 at 1:22 PM, Johan wrote: > Hi > > I know how to create a new command in manage.py, this link explains it > nicely : > https://docs.djangoproject.com/en/dev/howto/custom-management-commands/#command-objects > . But how do I create new command which would be available in django

Re: auth.User usernames

2012-02-20 Thread Tom Evans
On Sat, Feb 18, 2012 at 4:25 AM, Tai Lee wrote: > It's not that hard to just set up a OneToOneField back to User, and > use signals to automatically create a User when you create your own > User/Profile. Then you can still make use of 3rd party apps that rely > on contrib.auth or contrib.sessions,

Re: auth.User usernames

2012-02-16 Thread Tom Evans
On Wed, Feb 15, 2012 at 10:37 PM, Donald Stufft wrote: > I know this has been discussed before, but I wanted to bring it up again in > light of the oncoming Djnago 1.4 beta. > > Can we increase the length of the username field in auth.User? > I think that a max_length of 75 (to match the default E

  1   2   3   >