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: CSRF Middleware/SSL/Firefox 3.6.8 bug

2010-09-02 Thread Tom Evans
On Fri, Aug 27, 2010 at 7:53 PM, Luke Plant wrote: > > Finally, the only time we need Referer headers sent is for same origin > requests (POST requests to be exact).  Sending the Referer header in > this case is virtually never a privacy concern, since the site will > already be able to track wha

Re: CSRF Middleware/SSL/Firefox 3.6.8 bug

2010-09-03 Thread Tom Evans
On Fri, Sep 3, 2010 at 4:02 PM, Luke Plant wrote: > Hi Tom, > > On Thu, 2010-09-02 at 11:34 +0100, Tom Evans wrote: > >> Any sort of Referer checking is broken by design, since that header is >> clearly optional. RFC 2616 makes explicitly clear that applications >&

Re: 'User' object has no attribute 'backend' - issue with using auth.login()

2010-09-27 Thread Tom Evans
On Sat, Sep 25, 2010 at 11:13 AM, Harro wrote: > Authentication = verification > Login = saving the authenticated user so we remember them. > > Putting login on the user model is a bad idea. > That will only make the whole auth app less flexible than it already > is. > What if I have another model

Re: [Contact form] change Ukrainian locale

2010-09-29 Thread Tom Evans
The language code for Ukranian is uk: http://www.iana.org/assignments/language-subtag-registry Type: language Subtag: uk Description: Ukrainian Added: 2005-10-16 Suppress-Script: Cyrl UA is the country code for the Ukraine. Cheers Tom On Wed, Sep 29, 2010 at 2:44 PM, Jeremy Dunck wrote: > Ol

Re: contrib.staticfiles app concerns

2010-10-22 Thread Tom Evans
On Thu, Oct 21, 2010 at 9:04 PM, Jacob Kaplan-Moss wrote: > On Thu, Oct 21, 2010 at 1:25 PM, Waldemar Kornewald > wrote: >> Thanks a lot for the clarification. So, then the "bad batteries" part >> in Eric's talk "Why Django sucks and how we can fix it" doesn't >> receive much agreement within the

Re: Pluggable encryption for django auth (design proposal)

2010-11-30 Thread Tom Evans
On Sun, Nov 28, 2010 at 3:14 AM, Christophe Pettus wrote: > Hi, all, > > Right now, Django's auth system pretty much uses sha1 hardwired in > (literally, in the case of User.set_password) for the hash.  For a discussion > of why a general-purpose hash function is not the best idea in the world f

Re: Pluggable encryption for django auth (design proposal)

2010-12-01 Thread Tom Evans
On Wed, Dec 1, 2010 at 2:30 AM, Christopher Petrilli wrote: > On Tue, Nov 30, 2010 at 4:22 AM, Tom Evans wrote: > >> First comment is that Django already has a pluggable authentication >> stack, which already allows for this - simply define a new auth >> backend that t

Re: Feedback required: #14799 -- Problem with setting up test databases

2010-12-09 Thread Tom Evans
On Thu, Dec 9, 2010 at 11:45 AM, Russell Keith-Magee wrote: > > During the original multi-db design process, we considered allowing > for the definition of dependencies, but abandoned the idea because of > the complexity required to get automated synchronization correct in > every case. For exampl

Re: CBV FormView get_form_kwargs() doesn't.... when request.method == "GET"

2011-01-24 Thread Tom Evans
On Wed, Jan 12, 2011 at 11:19 PM, Andrew Godwin wrote: > On 12/01/11 17:54, Daniel Swarbrick wrote: >> Most of the time, I use POST for forms, but using GET is useful when >> developing a search form, for example. This is especially true if you >> want to paginate your results, because you still h

Re: One Django instance, hundreds of websites

2011-01-27 Thread Tom Evans
On Wed, Jan 26, 2011 at 6:18 PM, Jari Pennanen wrote: > On Jan 26, 6:56 pm, FeatherDark wrote: >> Greetings huge django developer list, >> I just wanted to mention, this method totally works for me, I call it >> "Skinning" >> >> In the templates folder I have a file called "base.html' >> Inside t

Re: Design design needed: #14093 - Unable to create a new session key on higher traffic

2011-02-10 Thread Tom Evans
On Thu, Feb 10, 2011 at 6:56 AM, Russell Keith-Magee wrote: > However, my concern here is that for any value of N, there will be > some level of traffic that will render that N insufficient. I'm not > fundamentally convinced that allowing N to be configurable will > actually fix the problem. I'd b

Re: Design design needed: #14093 - Unable to create a new session key on higher traffic

2011-02-10 Thread Tom Evans
On Thu, Feb 10, 2011 at 11:36 AM, Tom Evans wrote: > If this sounds amenable, I can code up a patch for the ticket. > Indeed, I was piqued, so did it anyway. Running with it now. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django

Re: Design design needed: #14093 - Unable to create a new session key on higher traffic

2011-02-10 Thread Tom Evans
On Thu, Feb 10, 2011 at 12:45 PM, Russell Keith-Magee wrote: > The DB model for cache keys provides for 40 characters, so we can > certainly store a UUID. If you can provide an implementation and can > demonstrate that it won't be prone to key collisions and won't impose > any computational limits

Re: Design design needed: #14093 - Unable to create a new session key on higher traffic

2011-02-10 Thread Tom Evans
On Thu, Feb 10, 2011 at 1:54 PM, Tom Evans wrote: > I've updated the ticket with a patch against trunk implementing uuid > session keys One of the reasons why it was coded like this was because you can not tell the difference in the cache backend between a key collision and mem

Re: Design design needed: #14093 - Unable to create a new session key on higher traffic

2011-02-11 Thread Tom Evans
On Fri, Feb 11, 2011 at 5:51 PM, Tim Graham wrote: > Tom, > > That definitely seems reasonable to me. Seems like the risk of key > collision is low enough that we shouldn't have to loop at all?  My > only concern regarding uui4 is the risk of collision with multiple web > servers.  From what I've

Re: Design design needed: #14093 - Unable to create a new session key on higher traffic

2011-02-14 Thread Tom Evans
On Sat, Feb 12, 2011 at 3:15 AM, Paul McMillan wrote: > Sorry, I stuffed up some of the numbers. > > MD5 is 128 bits equivalent value. UUID4 is 113. A table with enough > content to cause collisions for 10k input values would probably be in > the exabyte range, but the point still stands. Cache ti

Re: pb with search on website

2011-02-15 Thread Tom Evans
On Tue, Feb 15, 2011 at 9:44 AM, Tonton wrote: > maybe you still know that ! but some few weeks you change somethings on the > docs.djangoproject.com 's search engine ! > > and now all the time respons is no results found ! > > regards > > tonton > http://docs.djangoproject.com/search/?q=template

Re: Customizable Serialization

2011-03-08 Thread Tom Evans
On Mon, Mar 7, 2011 at 4:28 PM, Vivek Narayanan wrote: > ... > In the run up to May 23rd, I'll be familiarizing myself with the > codebase and community practices of Django, examining all the > integration points and looking at the best practices of serialization. > > Week 1: I'll be implementing

Re: Wrong error message when user having is_staff=False tries to login to admin

2011-03-14 Thread Tom Evans
2011/3/14 Juan Pablo Martínez : > I dont think so. > If I dont know the username and password I > can also try username and password and wait for the system > to send another different error message. then I get valid credentials. This is one of my bug-bears with the current authentication system -

Re: Default project layout / directory structure

2011-03-17 Thread Tom Evans
On Thu, Mar 17, 2011 at 5:08 AM, Tai Lee wrote: > If we're talking about the lowest common denominator and keeping > things simple, this is what I think we'd have: > > myapp1/ > myapp2/ > myproject/ > -django.wsgi.sample > -manage.py > -management/ > --commands/ > ---myproject_mycommand.py.sample

Re: Homogenization of User and UserProfile

2011-03-18 Thread Tom Evans
On Fri, Mar 18, 2011 at 2:22 PM, Carl Meyer wrote: > > > On 03/18/2011 08:09 AM, Alexander Schepanovski wrote: >> I think using subclass of User model for your fields has the same >> flexibility as separate profile model (since you can have only one). > > You can have multiple subclasses of the Us

Re: math tag

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 4:46 AM, Phui Hock wrote: > On May 3, 7:43 am, Russell Keith-Magee > wrote: >> This stems back to the design motivation of Django's template language >> -- you shouldn't be doing math in the template. Instead, you should be >> doing your math in the view, and providing the

Re: math tag

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 3:24 PM, Daniel Moisset wrote: > On Tue, May 3, 2011 at 9:19 AM, Tom Evans wrote: >> >> From another POV, there is no chance for the designer to screw the >> template up and calculate the wrong value, if he is only allowed to >> output data. >

Re: Django urls in JavaScript

2011-05-04 Thread Tom Evans
On Wed, May 4, 2011 at 12:38 PM, Jonathan Slenders wrote: > > Like gettext, a seperate, dynamically generated javascript file for > URL resolving is not scalable to lange web applications. > And further, I think that the urls and names of views are not meant to > be exposed to the client. I don't

Re: RFC: Composite fields API

2011-05-12 Thread Tom Evans
On Thu, May 12, 2011 at 12:41 PM, Michal Petrucha wrote: > As most of you have probably noticed by now, in a week and a half I'll > start working on the implementation of composite fields. Before that > we should probably agree on the final form of the API. > > Hi Michal This looks really, real

Re: Django Error Display Page

2011-06-09 Thread Tom Evans
On Wed, Jun 8, 2011 at 11:50 AM, Mateusz Harasymczuk wrote: > Hi, > I have been thinking about this for quite a long time. > Can you make an error display page less verbose? > I mean not to exclude those useful information, but to initially fold (hide) > them. > Fold those items: > - Python path a

Re: Sorting UX question

2011-06-09 Thread Tom Evans
On Thu, Jun 9, 2011 at 12:45 AM, Luke Plant wrote: > In the new admin sorting UI, which now supports sorting on multiple > fields, the behaviour can be described by the following two rules: > > 1. If you click on a header, it is made the primary sort field >   (with others moved down the list as n

Re: Deprecation policy for IE6

2011-06-10 Thread Tom Evans
On Fri, Jun 10, 2011 at 12:01 AM, Florian Apolloner wrote: > Hi, > > On Jun 9, 1:11 pm, Gert Van Gool wrote: >> I remember from the HTML5 doctype that some people (with app in enterprises) >> need the support > > Right, but even Google is dropping support for IE < 8 [1]! And if > Google is trying

Re: using decorators with argument in Python/Django

2011-06-28 Thread Tom Evans
On Tue, Jun 28, 2011 at 5:24 PM, Jigar Tanna wrote: > hey, > > I am new to Python and Django, was going through the concept of decorators > where I came across a special case of using arguments with decorators > Below is the code for memoization where I was looking at the concept... > > cache = {}

Re: Timezone-aware storage of DateTime

2011-06-30 Thread Tom Evans
On Thu, Jun 30, 2011 at 9:51 AM, Daniel Swarbrick wrote: > On Jun 29, 12:01 pm, Ryan McIntosh wrote: >> Is that a crutch of your database?  It isn't something I would ever live >> with.  All the *sql database servers I hate have an idea of what a >> timestamp+offset is.  Django should leverage th

Re: Timezone-aware storage of DateTime

2011-06-30 Thread Tom Evans
On Thu, Jun 30, 2011 at 1:14 PM, Daniel Swarbrick wrote: > I personally find it relatively useless to know what the wall clock > time was when something happened in another timezone. Right, but this isn't DanielsWebFramework, we need to cover more than what you find personally useful. Maybe what

Re: Named tuples queryset

2011-07-04 Thread Tom Evans
On Mon, Jul 4, 2011 at 11:19 AM, Paul Miller wrote: > Hi Yuri, > > I have not tested them for speed, but: > > - Named tuples have no instance dictionary, so their instances take no more > space than a regular tuple (for example, casting thousands of sql records to > named tuples has zero memory

Re: Decision for ticket #6362 - Remove blank spaces with strip when validating the data

2011-07-18 Thread Tom Evans
On Thu, Jul 14, 2011 at 10:35 PM, Luke Plant wrote: > On 10/07/11 22:26, Chris Beaven wrote: >> To clarify, didn't even notice we were talking about models.Field, I'm >> +0 for a 'strip' attribute on the form's field, nothing on the model. > > Like Chris, I don't think we can put this feature anyw

Re: Storing IP address as integer within database to remove need for full text search

2011-07-18 Thread Tom Evans
On Mon, Jul 18, 2011 at 3:56 PM, Cal Leeming [Simplicity Media Ltd] wrote: > Hi, > I have created a ModelField called RealIPAddressField. > It stores the IP address in integer form, meaning the lookups on large > tables are much faster: > http://djangosnippets.org/snippets/2493/ > @django-develope

Re: What is Django?

2011-08-24 Thread Tom Evans
On Tue, Aug 23, 2011 at 6:34 PM, Cal Leeming [Simplicity Media Ltd] wrote: > > +1 on this idea :) I don't think Russell is looking for votes on whether to do it, he's looking for someone to actually do it :) Cheers Tom -- You received this message because you are subscribed to the Google Grou

Exceptions thrown from middleware

2011-09-01 Thread Tom Evans
Hi all Currently, if a view throws an exception, the middleware classes that have a process_exception method will be called in reverse order to see if one of them can handle it and return a valid response before django's default exception handling takes over. This doesn't hold true for middleware

Re: PHP-inspired user-friendly in-browser DJango install

2011-09-12 Thread Tom Evans
On Fri, Sep 9, 2011 at 4:56 PM, Alec Taylor wrote: > Looks useable. > > Anyone interested in working with me to port this to DJango? Alec, as other people have mentioned, Django is not Drupal. Drupal is a web application that can be customized using plugins, where as Django is a python library on

Re: ManyRelatedManager with explicit intermediary model

2011-09-20 Thread Tom Evans
On Tue, Sep 20, 2011 at 4:12 PM, Roald de Vries wrote: > > I don't see how this is different from the create method on the intermediary > model. > > Cheers, Roald > > PS: I found an open ticket on this, > https://code.djangoproject.com/ticket/9475 > Here is the function definition for add() on re

Re: Revisiting proxied SSL headers

2011-09-26 Thread Tom Evans
On Sat, Sep 24, 2011 at 9:28 PM, Luke Plant wrote: > > I'm happy to be proved wrong, of course. Apache is very popular, though, > so if its hard in Apache, it could be said to be hard full stop. > RequestHeader unset X-Forwarded-Protocol Not precisely what I'd call hard. >From a-business-that

Re: Towards a more friendly NoReverseMatch

2011-10-12 Thread Tom Evans
On Wed, Oct 12, 2011 at 12:56 PM, Wilfred Hughes wrote: > It would be really good if we could improve the errors provided when > Django can't do reverse(). > > For example: > >    >>> reverse('i_dont_exist') >    NoReverseMatch: Reverse for 'i_dont_exist' with arguments '()' and > keyword argument

Re: Towards a more friendly NoReverseMatch

2011-10-20 Thread Tom Evans
On Wed, Oct 19, 2011 at 7:20 PM, Wilfred Hughes wrote: > 1. Can we provide an example of a pattern containing "|" that doesn't > work? I've successfully reversed the pattern r'^fruit/(bananas|apples) > $' above. Any regexp with alternation that is not part of a captured parameter: url(r'^homepag

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

2011-10-25 Thread Tom Evans
On Tue, Oct 25, 2011 at 1:28 PM, Thomas Guettler wrote: > Am 23.10.2011 21:59, schrieb feel: >> Hi, I wanted to propose a new possible feature in Django project that >> allows to sync the local folder with the remote one of the server >> defining all the configuration directly in settings.py. >> >

Re: queryset caching note in docs

2011-10-28 Thread Tom Evans
On Fri, Oct 28, 2011 at 11:23 AM, Marco Paolini wrote: > Hi all, > > I'd like to add a small note of warning about queryset caching in dos, > in topics/db/queries.txt "Caching and QuerySets" section, > something like: > > Keep in mind when looping through a queryset and altering data that > might

Re: queryset caching note in docs

2011-10-28 Thread Tom Evans
On Fri, Oct 28, 2011 at 1:05 PM, Marco Paolini wrote: > it's a bit more complex: there are basically two phases: >  1) row fetching from db using cursor.fetchmany() >  2) model instance creation in queryset > > both are delayed as much as possible (queryset lazyness) > > phase two (model instance

Re: queryset caching note in docs

2011-11-02 Thread Tom Evans
On Wed, Nov 2, 2011 at 11:28 AM, Marco Paolini wrote: > mysql can do chunked row fetching from server, but only one row at a time > > curs = connection.cursor(CursorUseResultMixIn) > curs.fetchmany(100) # fetches 100 rows, one by one > > Marco > The downsides to mysql_use_result over mysql_store_

Re: queryset caching note in docs

2011-11-02 Thread Tom Evans
On Wed, Nov 2, 2011 at 4:22 PM, Marco Paolini wrote: > On 02/11/2011 17:12, Tom Evans wrote: >> If you do a database query that quickly returns a lot of rows from the >> database, and each row returned from the database requires long >> processing in django, and you use m

Re: queryset caching note in docs

2011-11-03 Thread Tom Evans
On Thu, Nov 3, 2011 at 2:14 AM, Javier Guerra Giraldez wrote: > this seems to be the case with MyISAM tables; on the InnoDB engine > docs, it says that SELECT statements don't set any lock, since it > reads from a snapshot of the table. > > on MyISAM, there are (clumsy) workarounds by forcing the

Re: JsonField

2011-11-07 Thread Tom Evans
On Sat, Nov 5, 2011 at 11:48 AM, Ric wrote: > this is my proposition to have custom data inside a model field > > a json data field, the code is simple as this, and it works with > lastest django release > The problem with something like this is that it is rarely a good idea to stick opaque data

Re: JsonField

2011-11-08 Thread Tom Evans
On Mon, Nov 7, 2011 at 9:58 PM, Ric wrote: > django should be able to handle this kind of situation, and please > don't be arrogant. Hi, I'm sorry you felt that I was being arrogant - I don't know the situations of your project, it may well be exactly what is needed in that situation. I was only

Re: JsonField

2011-11-08 Thread Tom Evans
On Mon, Nov 7, 2011 at 11:48 PM, Torsten Bronger wrote: > > While I appreciate that Django core is supposed to enforce good > design practices, one must be careful with that if some practice may > have valid use cases.  You cannot prevent the user from shooting in > the foot anyway. > > While we m

Re: TemplateResponse and loader should handle request

2011-11-10 Thread Tom Evans
On Wed, Nov 9, 2011 at 7:10 PM, Doug Ballance wrote: > I very much like the idea of an optional keyword argument and > fallback.  The template loader is one of the few places I've been > forced to use threadlocals to get get the job done. > Please no - an optional argument is all well and good, u

Re: TemplateResponse and loader should handle request

2011-11-10 Thread Tom Evans
On Thu, Nov 10, 2011 at 10:20 AM, Florian Apolloner wrote: > Hi, > > On Thursday, November 10, 2011 10:43:01 AM UTC+1, Tom Evans wrote: >> >> Please no - an optional argument is all well and good, until people >> >> I don't get why it is difficult to extrac

Re: Accessing dictionaries in templates in a sorted manner

2009-06-11 Thread Tom Evans
On Wed, 2009-06-10 at 06:54 -0700, Adrian Rogers wrote: > On Jun 9, 11:09 am, Tom Evans wrote: > > Hi all > > > > I was struggling to turn a typical template dictionary iteration use > > case into a sorted dictionary iteration, and struggling to find any way >

Re: Accessing dictionaries in templates in a sorted manner

2009-06-11 Thread Tom Evans
On Thu, 2009-06-11 at 09:37 -0500, Alex Gaynor wrote: > > > On Thu, Jun 11, 2009 at 4:09 AM, Tom Evans > wrote: > > > On Wed, 2009-06-10 at 06:54 -0700, Adrian Rogers wrote: > > On Jun 9, 11:09 am, Tom Evans >

Re: Accessing dictionaries in templates in a sorted manner

2009-06-11 Thread Tom Evans
On Thu, 2009-06-11 at 11:30 -0400, Karen Tracey wrote: > On Thu, Jun 11, 2009 at 11:07 AM, Tom Evans > wrote: > > > > I appreciate that; I'm asking if this undocumented feature is > expected > to work for the fores

Re: Accessing dictionaries in templates in a sorted manner

2009-06-15 Thread Tom Evans
On Fri, 2009-06-12 at 04:48 +0700, Yuri Baburov wrote: > Hi Tom, > > SortedDict(yourdict) is a hard thing and takes a lot of tinkering? > don't you have python 2.4 to use sorted(dict.iteritems())? > can't write your own python function to do this in your views side? > > next, |dictsort:"0" is wo

Re: models.fields.Field default value rational

2009-06-30 Thread Tom Evans
On Mon, 2009-06-29 at 14:12 -0700, Rodrigue wrote: > Hi all, > > I came across a behaviour that somewhat surprised me on the model > fields. Namely, if you have a Field with no default value, an empty > value for that field is likely to be turned into the empty string by > Field.get_default. > >

Re: Try out new inline features [GSoC admin-ui]

2009-07-07 Thread Tom Evans
On Mon, 2009-07-06 at 07:26 -0700, andybak wrote: > Nice! > > Are you planning to do anything to finesse the behaviour of the > 'delete' button? It would be nice (especially on selector inlines) if > it looked like items disappeared immediately. > > I also feel the admin change pages needs a 'ca

Re: Try out new inline features [GSoC admin-ui]

2009-07-07 Thread Tom Evans
On Tue, 2009-07-07 at 09:45 +0100, Andy Baker wrote: > Mmmm. That's a fair point but that article was written before web > applications were so application-ey and expectations may well have > changed. (I've noticed a lot of semi-modal dialogs in web apps > complete with 'cancel' buttons and with j

#8087: Adding support for lists to the template if tag

2009-08-04 Thread Tom Evans
Hi all A while ago, I added support for testing if an element is in a list to the 'if' template tag. The diff is attached to ticket 8087, complete with unit tests and documentation. Could a committer take a look at this change, and advise me what additional work/changes would be required in orde

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: 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: 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: 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-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: 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: 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 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-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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: request for API review of streaming responses additions

2015-09-07 Thread &#x27;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: Get current user in model signal pre_save

2015-09-09 Thread &#x27;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: Making max_length argument optional

2015-09-21 Thread &#x27;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: Making max_length argument optional

2015-09-22 Thread &#x27;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: #25582: Add a way to build URLs with query strings

2015-10-23 Thread &#x27;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: Provide a way to pass kwargs when initializing the storage class

2015-11-07 Thread &#x27;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: Automatic prefetching in querysets

2017-08-16 Thread &#x27;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: Having a MongoDB connector for Django

2017-09-08 Thread &#x27;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: Having a MongoDB connector for Django

2017-09-18 Thread &#x27;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: Adding an some warnings, checks, or exceptions for urls

2016-04-25 Thread &#x27;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: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-17 Thread &#x27;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: #27485 new New feature Allow ALLOWED_HOSTS to accept an IP-range / wildcard

2016-11-23 Thread &#x27;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: Django 2.0 Python version support (Python 3.6+ only?)

2017-01-06 Thread &#x27;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: Time based one time password and django ?

2017-01-17 Thread &#x27;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/

<    1   2   3   >