Re: start using less (and bootstrap!)

2012-02-02 Thread Alex Gaynor
On Thu, Feb 2, 2012 at 5:01 PM, Adrian Holovaty wrote: > On Thu, Feb 2, 2012 at 2:49 PM, Sean Brant wrote: > > Is this up somewhere public? I've been fighting the urge to do this as > > well. Using django-compressor with less on Heroku is a non-starter > > since you can't install node. Having th

Re: Why recommend to include project name in settings?

2012-02-10 Thread Alex Gaynor
On Fri, Feb 10, 2012 at 10:57 AM, Carl Meyer wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 02/10/2012 08:47 AM, Adam "Cezar" Jenkins wrote: > > On Fri, Feb 10, 2012 at 9:50 AM, Carl Meyer > > wrote: > > > > "import .module" > > > > > > Not arguing o

Re: Revisiting multiline tags

2012-02-24 Thread Alex Gaynor
On Fri, Feb 24, 2012 at 10:01 AM, Daniel Moisset wrote: > On Fri, Feb 24, 2012 at 6: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 subscribe

Re: Revisiting multiline tags

2012-02-24 Thread Alex Gaynor
in the eyes of the beholder, but the reason we have BDFLs is to keep those decisions consistent. Glyph Lefkowitz's keynote from DjangoCon this year really drives this home. > > On Feb 24, 10:15 am, Daniel Moisset wrote: > > On Fri, Feb 24, 2012 at 12:12 PM, Alex Gaynor > wro

Re: call_command; add *.pyc and *.pyo files to commands list

2012-02-29 Thread Alex Gaynor
On Wed, Feb 29, 2012 at 6:56 PM, John Paulett wrote: > Related tickets are #14952 and #12206. #14952 includes a possible > patch, but marked as wontfix. > > However, I'm definitely +1 on adding support for pyc/pyo support for > management commands. I understand the arguments against deploying >

Re: Tagging 1.4 django release in Subversion

2012-03-26 Thread Alex Gaynor
On Mon, Mar 26, 2012 at 9:00 PM, Łukasz Rekucki wrote: > On 27 March 2012 02:44, Reinout van Rees wrote: > > On 26-03-12 18:13, Florian Apolloner wrote: > >> > >> > >>I'm also intrigued how you have a release tarball before you have > >>tagged the release! > >> > >> It's magic :ş > > > >

Re: Dropping django.utils.simplejson

2012-03-29 Thread Alex Gaynor
On Thu, Mar 29, 2012 at 6:07 PM, Łukasz Rekucki wrote: > Alex's comment on ticket #18013 reminded me of this. Is there any > reason not to get rid of the Django's version of simplejson now that > Python 2.6 always has the json module? > > I see three options here: > > 1) Remove Django's copy and

Re: Dropping django.utils.simplejson

2012-03-29 Thread Alex Gaynor
On Thu, Mar 29, 2012 at 10:06 PM, Alex Ogier wrote: > So in the process of removing simplejson I realized it's not strictly > true that we no longer need to bundle it: if someone uses 2.6+ but has > a 'json' module with a different interface sitting in front of the > system json on sys.path, then

Re: auth.user refactor: the profile aproach

2012-04-05 Thread Alex Gaynor
On Thu, Apr 5, 2012 at 1:02 PM, Adrian Holovaty wrote: > 2012/4/5 Ian Lewis : > > I'm curious though how the admin fits into your ideas. If you wanted to > use the > > admin, would you have to use a User model that has and or supports all > the > > cruft on the current user model? e.g. username,

Re: Proposed Field API additions

2012-06-07 Thread Alex Gaynor
On Thu, Jun 7, 2012 at 12:17 PM, Andrew Godwin wrote: > Hi everyone, > > As part of my planning for adding schema alteration/migrations into > Django proper, I need to make a few changes to Fields to allow for > better serialisation of model definitions (pretty much a requirement for > any change

Re: Proposal: Add some extensibility / decoupling features to Django templates

2012-06-24 Thread Alex Gaynor
On Sun, Jun 24, 2012 at 2:50 PM, Jacob Kaplan-Moss wrote: > On Sat, Jun 23, 2012 at 7:17 PM, Yo-Yo Ma > wrote: > > Without changing any of the existing functionality or settings in Django, > > refactor the template system to use an ``Environment`` class (something > akin > > to Jinja2's ``Environ

Re: I think adding a "first" method to the QuerySet be useful.

2012-07-02 Thread Alex Gaynor
On Mon, Jul 2, 2012 at 9:27 PM, Maxime Haineault wrote: > One of the common pitfall I come across way to often with novices is > something like this: > > def getFirstUser(): > return User.objects.all()[0] > > It looks innocuous and often wont raise any exceptions in dev because you > d

Re: Python 3 - style question

2012-08-10 Thread Alex Gaynor
On Fri, Aug 10, 2012 at 3:45 PM, Simon Meers wrote: > > On 10 August 2012 18:56, Vinay Sajip wrote: > >> I think Option 2 is better, for the reasons you state. > > +1. And it's not too entangled to be easily stripped out if/when > Python 2 support is removed. > > On 11 August 2012 06:10, Łukasz

Re: new syntax for management commands

2012-08-12 Thread Alex Gaynor
On Sun, Aug 12, 2012 at 4:51 PM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > On Sun, Aug 12, 2012 at 6:32 PM, Florian Apolloner > wrote: > > Hi, > > > > > > On Sunday, August 12, 2012 2:22:58 AM UTC+2, Russell Keith-Magee wrote: > >> > >> I'll agree that it looks appealing. However, a

Re: Breaking out localflavor

2012-08-16 Thread Alex Gaynor
On Thu, Aug 16, 2012 at 9:38 PM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > On Fri, Aug 17, 2012 at 5:26 AM, Adrian Holovaty > wrote: > > I'd like to move all Django localflavor code into a separate package, > > distributed separately from Django the framework. > > +1. I've had the e

Re: Breaking out localflavor

2012-08-16 Thread Alex Gaynor
On Thu, Aug 16, 2012 at 9:42 PM, Jacob Kaplan-Moss wrote: > On Thu, Aug 16, 2012 at 3:38 PM, Adrian Holovaty > wrote: > > You mean like a magic import thing, right? > > Well, Python *does* have some namespace package support stuff. It's > something of a mess, with one implementation internally, a

Re: Streaming HttpResponse revisted. Any core devs, please take a look if you can :)

2012-08-20 Thread Alex Gaynor
On Mon, Aug 20, 2012 at 12:19 PM, Anssi Kääriäinen wrote: > > > On 20 elo, 18:39, Tai Lee wrote: > > I'd like to re-visit the discussion surrounding #7581 [1], a ticket about > > streaming responses that is getting quite long in the tooth now, which > > Jacob finally "accepted" 11 months ago (aft

Re: ORM refactoring, part 2

2012-08-25 Thread Alex Gaynor
On Sat, Aug 25, 2012 at 12:35 PM, Anssi Kääriäinen wrote: > I have done some more ORM refactoring work. I thought it would be a > good idea to post a summary of what is going on. > > First, I haven't committed the utils.tree refactoring patch I was > planning to commit [https://github.com/akaariai

Re: Auto-import support for models and other objects in shell

2012-08-28 Thread Alex Gaynor
On Tue, Aug 28, 2012 at 2:40 PM, Phill Tornroth wrote: > 'Ello. > > I'm gauging support for a tiny new feature, or at least a refactoring of > an internal API that will allow the feature to be developed without code > duplication. I'd like to stop typing import statements for all of my models > an

Re: iPython behaves strangely only with Django shell

2012-08-29 Thread Alex Gaynor
On Wed, Aug 29, 2012 at 9:37 AM, Jacob Kaplan-Moss wrote: > This looks like some sort of error in your environment; I can't reproduce > it:: > > $ ./manage.py shell > In [1]: import decimal > > In [2]: class F(object): >...: d = decimal.Decimal('0') >...: > > In

Re: Schema Alteration - Review needed!

2012-09-17 Thread Alex Gaynor
On Mon, Sep 17, 2012 at 3:59 PM, Andrew Godwin wrote: > Hi all, > > I have now, I believe, got a working, feature-complete schema alteration > branch ready to go. It has full support for PostgreSQL, MySQL, and SQLite, > and follows the rough design principles I emailed the list about a while > ba

Re: ORM refactoring, part 2

2012-09-25 Thread Alex Gaynor
On Tue, Sep 25, 2012 at 7:25 AM, Jacob Kaplan-Moss wrote: > On Tue, Sep 25, 2012 at 3:23 AM, Anssi Kääriäinen > wrote: > > I'd like to postpone these to early next month so that I have more > > time to help in reviews and pushing some new features in. Other > > options are postponing review work,

Re: URL dispatcher slow?

2012-10-11 Thread Alex Gaynor
On Thu, Oct 11, 2012 at 6:52 AM, Daniel Sokolowski < daniel.sokolow...@klinsight.com> wrote: > I absolutely agree with: if we were looking for speed we wouldn't use > python at all (period). > > Speak for yourself. Alex -- "I disapprove of what you say, but I will defend to the death your rig

Re: save() method could return the object

2012-10-12 Thread Alex Gaynor
On Fri, Oct 12, 2012 at 6:36 AM, Yo-Yo Ma wrote: > +1 > > A lot of people are overriding ``save`` and not returning anything, but > this isn't going to hurt them (ideally, they should already be returning > the result of ``super(``, but nobody does). > > > On Friday, October 12, 2012 9:25:46 AM U

Re: save() method could return the object

2012-10-12 Thread Alex Gaynor
On Fri, Oct 12, 2012 at 6:40 AM, Chris Wilson wrote: > On Fri, 12 Oct 2012, Marijonas Petrauskas wrote: > > There already exists create method that does exactly what you need:obj = >> SomeModel.objects.create(name=**'foo', age=42) >> > > OK, thanks, that appears to be completely undocumented. >

Re: Add a "split" field to a model causes problems

2012-10-23 Thread Alex Gaynor
On Tue, Oct 23, 2012 at 5:11 PM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > > > On Tue, Oct 23, 2012 at 6:52 PM, Andrew Ingram wrote: > >> Hi all, >> >> This one stung me today. Basically as part of an event (calendar) app, I >> have functionality for splitting a series of events into

Re: Call for use cases of metrics in django core

2012-10-31 Thread Alex Gaynor
On Wed, Oct 31, 2012 at 9:52 PM, Eric Holscher wrote: > A couple obvious places: > > Latency to backend systems. So, any time that I call out to my cache > backend or database, keep track of round trip latency of those. > > Full system latency. So, From the time a request enters the URL routing >

Re: proposal: post-collectstatic signal

2012-11-10 Thread Alex Gaynor
What's the use case? Alex On Sat, Nov 10, 2012 at 8:48 PM, Justin Holmes wrote: > Currently, our only built-in management signal is post-syncdb. > > I propose (and, notwithstanding objection, will build) > post-collectstatic. > > Is this reasonable? Is there another, less invasive way to hook

Re: GitHub migration

2012-11-25 Thread Alex Gaynor
One major improvement I've seen is that when there's a small issue in a commit (such a typo) a contributor often leaves an inline comment and it can get fixed directly. This is a great workflow for simple issues. Alex On Sun, Nov 25, 2012 at 3:46 PM, Aymeric Augustin < aymeric.augus...@polytechn

Re: Proposal: Composite Foreign Keys

2012-11-29 Thread Alex Gaynor
No, there is no such solution in the codebase. Are you aware of a patch we should be reviewing on this issue? Alex On Thu, Nov 29, 2012 at 2:43 PM, Ron Smith wrote: > So here we are 4 years later, version 1.5 is about to be released and we > still don't have a solution for composite primary ke

Re: First request - Modify django.core.management.color with settings option

2012-12-19 Thread Alex Gaynor
I too think a setting is inappropriate for this, I'm also a little skeptical of an env var, is this not a bug with PyCharm? Alex On Wed, Dec 19, 2012 at 1:08 PM, Florian Apolloner wrote: > I dislike a setting for this, an optional environment variable would make > more sense imo (since you usua

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread Alex Gaynor
I would like to *strongly* object to adding any notion of root path (and relative paths with it) to Django. This would be furthering the notion that a django project is a thing. It's not. You don't hear twisted people talking about the twisted project root, or any other python package. The notion o

Re: Database pooling vs. persistent connections

2013-02-18 Thread Alex Gaynor
As far as I know, the MySQL timeout time is configurable, and the default is 8 hours. Alex On Mon, Feb 18, 2013 at 2:30 PM, Karen Tracey wrote: > Just a couple of random quick thoughts: > > Will persistent connections be able to ensure that "bad connections" (e.g. > those in state "current tra

Re: clarification of API backwards-compatibility policy

2013-02-19 Thread Alex Gaynor
I agree, backwards compatibility for an API should be opt-in (via documenting), not opt-out (via naming). Alex On Tue, Feb 19, 2013 at 1:56 PM, Carl Meyer wrote: > Hi, > > I was just about to tell someone on IRC that Django's > backwards-compatibility policy only applies to documented methods

Re: Database pooling vs. persistent connections

2013-02-19 Thread Alex Gaynor
I don't really see what point such an option would serve. This is *not a connection pool*. Currently Django uses one open connection per thread, this simple keeps them open between requests. That means before: you needed O(concurrent threads) connections, now you need O(total active threads) connec

Re: Switch to database-level autocommit

2013-03-01 Thread Alex Gaynor
+1 from me. Here's a patch to add autocommit to MySQL: https://github.com/django/django/pull/857 FWIW: any sort of scheme where a transaction is kept open all request (including a transaction that only ever reads), will cause you serious pain if you're trying to do migrations on MySQL with traffic

Re: Proposal: deprecate and remove django.contrib.comments

2013-03-07 Thread Alex Gaynor
Jumpin' on the +1 train. Choo, choo! Alex On Thu, Mar 7, 2013 at 9:04 AM, Donald Stufft wrote: > On Mar 7, 2013, at 11:48 AM, Jacob Kaplan-Moss wrote: > > > Hi folks -- > > > > This one's simple: I'd like to deprecate `django.contrib.comments`, > > scheduling it to be removed in a couple of r

Re: Proposal: deprecate and remove django.contrib.comments

2013-03-07 Thread Alex Gaynor
It's not like /dev/null'ing it erases it from the annals of history. I don't see what the point of creating an un-maintained repo is, if someone decides they want to maintain it at some later point it's pretty trivial to resurrect from VCS history. Alex On Thu, Mar 7, 2013 at 4:29 PM, Michael Ma

Re: Using EXISTS instead of IN for subqueries

2013-03-25 Thread Alex Gaynor
I have no idea how EXISTS performs on MySQL, however I can say that IN + subqueries on MySQL are so atrocious that we outright banned that where I work, so I don't see how it could be worse :) Alex On Mon, Mar 25, 2013 at 8:37 AM, Anssi Kääriäinen wrote: > On 25 maalis, 13:23, Simon Riggs wrot

Re: Using EXISTS instead of IN for subqueries

2013-03-26 Thread Alex Gaynor
For what it's worth, SQL2011 does define OFFSET, finally. Alex On Tue, Mar 26, 2013 at 5:00 PM, Petite Abeille wrote: > > On Mar 26, 2013, at 4:19 PM, Michael Manfre wrote: > > > Maybe someday the non-standard LIMIT/OFFSET keywords will get added to > the > > standard (I truly hope this happen

Re: django.utils.simplejson + stdlib json

2013-04-11 Thread Alex Gaynor
I basically agree with what Bob said on the ticket, it's unclear to me from your email how this manifests, other than trying to use something from the standard library with simplejson, which is obviously wrong. Alex On Thu, Apr 11, 2013 at 5:51 PM, Jeremy Dunck wrote: > I've just seen a docume

Re: django.utils.simplejson + stdlib json

2013-04-11 Thread Alex Gaynor
When doing what? What do I need to do to trigger this? Alex On Apr 11, 2013 6:16 PM, "Jeremy Dunck" wrote: > If a user of django has simplejson installed, django itself will use both > the stdlib and simplejson. > > On Apr 11, 2013, at 5:54 PM, Alex Gaynor wrote: >

Re: Changing deferred model attribute behavior

2013-04-25 Thread Alex Gaynor
This sounds like a reasonable request, I don't yet have an opinion on API or anything. One tiny thing I'd like to note though, "change DeferredAttribute to find all *other* DeferredAttributes". I don't think `finding` is the right way to think about it, a `DeferredAttribute` with loadall semantics

Re: Changing deferred model attribute behavior

2013-04-25 Thread Alex Gaynor
Sorry, I misunderstood the original request. Yes, you're right Anssi and Adrian, finding them on demand is reasonable. Alex On Thu, Apr 25, 2013 at 4:59 PM, Anssi Kääriäinen wrote: > On 25 huhti, 20:08, Alex Gaynor wrote: > > This sounds like a reasonable request, I don't

Re:

2013-05-02 Thread Alex Gaynor
I'll also second that, in addition to the methodological flaws I see, they don't do any testing of running Django under PyPy, which has seen significant speed boosts in the wild. Alex On Thu, May 2, 2013 at 10:50 AM, Jacob Kaplan-Moss wrote: > On Thu, May 2, 2013 at 1:34 PM, Michał Nowotka wro

Re: first() and last(), earliest() and latest()

2013-05-16 Thread Alex Gaynor
Querysets definitely support indexing. Alex On Thu, May 16, 2013 at 2:51 PM, Alex Ogier wrote: > QuerySets don't support indexing. I'm not entirely sure why, but I > think the reason is to encourage more efficient database usage, since > naive usage of indexing would lead to many repeated LIMI

Re: Cursor closing or reuse: am I missing something?

2013-05-17 Thread Alex Gaynor
Right now Django absolutely does not close all cursors, if you look at django/db/models/sql/compiler.py def execute_sql (sorry, going from memory here) you'll see this. It'd be good if it did. There used to be some crazy stuff around reading chunks and emitting those, now that I believe Anssi has r

Re: ANN: Django website redesign launched

2014-12-16 Thread Alex Gaynor
Hi Christian, While I'm sure you didn't mean it this way, your email frankly makes you sound like an jerk, and that tone is not appropriate for this list. You've not substantiated any of your claims, other than that it your personal preference. If you'd like to make specific, *actionable* sugges

Re: DKIM signing option for stmp.MailBackend?

2015-04-04 Thread Alex Gaynor
I agree that DKIM is the responsibility of an MTA, not Django. Alex On Sat, Apr 4, 2015 at 6:53 AM, Bruno Ribeiro da Silva < bruno.dev...@gmail.com> wrote: > I do think DKIM is a task for the MTA too, so it doesn't make much sense > to have it in django's core. > On Apr 4, 2015 6:27 AM, "Claude

Re: SSL support for Django-admin runserver‏

2015-05-11 Thread Alex Gaynor
I don't have a strongly held opinion on whether Django should include this, but if it's going to, it should include a *well configured* TLS server, utilizing modern TLS cipher suites, TLS versions, etc. We shouldn't be yet another part of the "well, it's not *my* job to configure OpenSSL correctly"

Re: Add DoNotTrack (DNT) middleware?

2015-08-29 Thread Alex Gaynor
I would say no: this does _so_ little, and it's completely implementable outside of Django. Moreover, adding the middleware doesn't change any behavior, you still have to do a bunch of work in your app to actually implement the not-tracking logic. Alex On Sat, Aug 29, 2015 at 1:17 PM, Tim Graham

Re: Methodology for increasing the number of PBKDF2 iterations

2015-09-20 Thread Alex Gaynor
Unfortunately here is where we hit an asymmetry: single threaded performance of PBKDF2 _as realized in our pure Python implementation_ indeed does not improve by 25% every 8 months. Unfortunately 24k iterations is behind where we'd want to be (~100k iterations, or a factor of 4, last I checked).

Re: Methodology for increasing the number of PBKDF2 iterations

2015-09-22 Thread Alex Gaynor
Sure, but such a problem has nothing to do with password upgrades, it can already be triggered by registration, or even just logging in without a password upgrade. Alex On Tue, Sep 22, 2015 at 2:43 PM, Tim Graham wrote: > Sorry, I explained poorly. We do upgrade passwords when the iteration > c

Re: Statistic app. Any suggestion?

2010-08-28 Thread Alex Gaynor
On Sat, Aug 28, 2010 at 12:38 AM, Lucian Romi wrote: > I want to make a statistic. There is a float field in my model(table). > I want to use a chart to show what's the percentage in each range. > Any suggestion to make such and app that can fit into django model. Thanks. > > -- > You received thi

Re: a new template algorithm

2010-08-28 Thread Alex Gaynor
On Sat, Aug 28, 2010 at 11:47 AM, Gabriele Fantini wrote: > Hi, > > I've just joined this group. The reason is that I've recently > developed a new django template system (and I'm still working on it) > and I'm currently using it for my new sites. > I hope this is the right place to discuss of suc

Re: parameterized apps (was: Re: Eric Florenzano's presentation slides)

2010-09-09 Thread Alex Gaynor
On Thu, Sep 9, 2010 at 1:59 PM, Russell Keith-Magee wrote: > On Thu, Sep 9, 2010 at 10:24 PM, Javier Guerra Giraldez > wrote: >> from Eric Florenzano's slide 41: >> >>  In models.py: >> >>  class Favorite(models.Model): >>      item = LazyForeignKey(‘fave’) >>      user = ForeignKey(User) >>    

Re: get_next_by_FOO allows nulls

2010-09-12 Thread Alex Gaynor
On Sun, Sep 12, 2010 at 1:09 PM, Carl Karsten wrote: > On Thu, Aug 26, 2010 at 8:12 PM, Russell Keith-Magee > wrote: >> On Fri, Aug 27, 2010 at 2:12 AM, Carl Karsten wrote: >>> I would like to discus my patch to add support of nullable fields to >>> get_next_by_FOO >>> >>> http://code.djangoproj

Re: making queryset.delete issue only a single SQL query

2010-09-19 Thread Alex Gaynor
On Sun, Sep 19, 2010 at 10:28 AM, drakkan wrote: > > > On 17 Set, 15:38, Tobias McNulty wrote: >> On Fri, Sep 17, 2010 at 8:27 AM, SmileyChris wrote: >> >> >  On Sep 11, 1:12 pm, Tobias McNulty wrote: >> > > I may be missing something, but queryset.delete() seems oddly implemented >> > in >> >

Re: proposal for lazy foreignkeys

2010-09-25 Thread Alex Gaynor
On Sat, Sep 25, 2010 at 1:47 PM, Carl Meyer wrote: > Hi all, > > I've seen some level of interest in the idea of a lazy foreign key > (one whose target table is determined by project configuration in some > way, not hardcoded by the app/model in which it lives). The idea was > most recently brough

Re: #12991 Adding support for unittest2: request for review

2010-09-26 Thread Alex Gaynor
On Sun, Sep 26, 2010 at 8:44 PM, Russell Keith-Magee wrote: > On Mon, Sep 27, 2010 at 6:24 AM, Karen Tracey wrote: >> I've run it on Python 2.4 & 2.5 (Ubuntu, sqlite DB) with no problems. >> >> I do have some feedback on the @skipIfDB addition: I'd really like if this >> could be used to distingu

Re: four NoSQL backends you want? :)

2010-09-27 Thread Alex Gaynor
On Mon, Sep 27, 2010 at 7:22 PM, Russell Keith-Magee wrote: > On Tue, Sep 28, 2010 at 1:51 AM, Mark Bucciarelli wrote: >> On Sat, Sep 25, 2010 at 10:21:06PM +0800, Russell Keith-Magee wrote: >>> >>> The number 4 wasn't actually the important bit - it was that I want >>> to see a range of noSQL ap

Re: #12012 Logging: request for comments

2010-09-28 Thread Alex Gaynor
I don't see how a 302 because someone posted something is any less debug thann the 200 to serve thhhe get. Bikesheddinngly yours, Alex On Sep 28, 2010 11:45 AM, "Ian Lewis" wrote: Hi, On Tue, Sep 28, 2010 at 9:19 AM, Nick Phillips wrote: > I'm worried by ... I'm split on this myself but I th

Re: #6735 -- Class based generic views: call for comment

2010-10-01 Thread Alex Gaynor
On Fri, Oct 1, 2010 at 9:53 AM, Vinay Sajip wrote: > On Oct 1, 11:16 am, Johannes Dollinger > wrote: >> Could you (or anyone knowledgable) add a section, that explains why each >> request should have its own view instance? >> The thread-safety argument alone does not suffice: if all _request_ st

Re: #6735 -- Class based generic views: call for comment

2010-10-01 Thread Alex Gaynor
On Fri, Oct 1, 2010 at 11:16 AM, Russell Keith-Magee wrote: > On Fri, Oct 1, 2010 at 6:16 PM, Johannes Dollinger > wrote: >> Am 01.10.2010 um 07:26 schrieb Russell Keith-Magee: >>> I've just added a summary of the last thread on class-based views [1]. >>> This summary isn't 100% complete -- any c

Re: #6735 -- Class based generic views: call for comment

2010-10-04 Thread Alex Gaynor
On Mon, Oct 4, 2010 at 1:04 PM, Andrew Godwin wrote: > On 04/10/10 17:28, legutierr wrote: >> >>   * First, treat data processing and retrieval as separable from >> rendering.  Create a bright line of separation between the two >> conceptual elements of the view (data and rendering), and do it ear

Re: Google Code-in: any volunteers?

2010-10-07 Thread Alex Gaynor
On Thu, Oct 7, 2010 at 3:30 PM, Jacob Kaplan-Moss wrote: > Hi folks -- > > Google's open source team is putting together a new program, called > "Google Code-in". It's a program to get 13-18 years old students > involved in open source by giving them sets of small, distinct tasks > to work on. The

Re: Migrating doctests to unittests

2010-10-08 Thread Alex Gaynor
Yes, and yes. :) Alex 2010/10/8 Filip Gruszczyński : > I am not sure, but I think I have seen it mentioned somewhere, so I > would like to ask: are tests django being migrated from doctests to > unit tests and is it desirable to provide patches with such migration? > > -- > Filip Gruszczyński > >

Ticket #5416 -- assertNumQueries

2010-10-10 Thread Alex Gaynor
Hey all, I've been spending some time with ticket #5416[0], which is a request for assertNumQueries in tests. The primary objection Russ had to the previous patch in this vein was that It uses connection.queries as opposed to the proposed signal. However, Russ and I spoke last night and neither

Re: Migrating doctests to unittests

2010-10-10 Thread Alex Gaynor
ttp://henriquebastos.net > Skype: henriquebastos.net > Twitter: @henriquebastos > +55 21 9618-6180 > > > > 2010/10/8 Filip Gruszczyński >> >> Thanks :-) >> >> 2010/10/8 Alex Gaynor : >> > Yes, and yes. :) >> > >> > Alex &g

Re: Ticket #5416 -- assertNumQueries

2010-10-10 Thread Alex Gaynor
On Mon, Oct 11, 2010 at 2:02 AM, Russell Keith-Magee wrote: > 2010/10/11 Mikhail Korobov : >> Hi all, >> >> If it will be a contextmanager then it can also be extended to perform >> like a decorator: http://gist.github.com/573536 >> I think this can be useful. > > Alex and I have spoken about this

Re: Ticket #5416 -- assertNumQueries

2010-10-11 Thread Alex Gaynor
On Mon, Oct 11, 2010 at 4:47 AM, Russell Keith-Magee wrote: > On Mon, Oct 11, 2010 at 4:35 PM, Andrew Godwin wrote: >> On 11/10/10 07:05, Alex Gaynor wrote: >>> >>> I think the solution there is something like: >>> >>> @skipUnless(sys.versi

Re: Migrating doctests to unittests

2010-10-11 Thread Alex Gaynor
On Mon, Oct 11, 2010 at 12:55 AM, Russell Keith-Magee wrote: > On Mon, Oct 11, 2010 at 12:43 PM, Alex Gaynor wrote: >> On Mon, Oct 11, 2010 at 12:41 AM, Henrique Bastos >> wrote: >>> Alex, >>> Is there any specific branch on unit testing migration? It would be

Re: Ticket #5416 -- assertNumQueries

2010-10-11 Thread Alex Gaynor
On Mon, Oct 11, 2010 at 2:05 PM, Jacob Kaplan-Moss wrote: > On Mon, Oct 11, 2010 at 12:29 PM, Alex Gaynor wrote: >> I've uploaded a new patch [...] > > Looks pretty good to me. > > I must say, though, that I'm not completely happy with the API. I find > ``asse

Re: parse xml

2010-10-15 Thread Alex Gaynor
On Fri, Oct 15, 2010 at 1:38 PM, kostia wrote: > I have xml file: > > >        5 > > > I want to get the value of n (= 5) inside my python program, I'm > doing this: > > import xml.dom.minidom > from xml.dom.minidom import Node > doc = xml.dom.minidom.parseString("boolean_width.xml") >

Re: Why does transaction management only commit on is_dirty?

2010-10-22 Thread Alex Gaynor
On Fri, Oct 22, 2010 at 7:01 PM, Jacob Kaplan-Moss wrote: > On Fri, Oct 22, 2010 at 5:59 PM, Christophe Pettus wrote: >> Why does transaction management only commit on is_dirty? > > It's a bug: http://code.djangoproject.com/ticket/9964. > > Looks like the patch there is OK, but still needs some w

Re: Django on Google App Engine via SQL (not nonrel)

2010-10-26 Thread Alex Gaynor
On Tue, Oct 26, 2010 at 6:56 PM, wesley chun wrote: > Dear Django developers, > > I got in touch with Jacob who suggested I contact you all together. As > you may (or may not) know, at Google I/O back in May, we announced a > hosted cloud SQL service as a new feature for our App Engine > applicati

Re: Django on Google App Engine via SQL (not nonrel)

2010-10-26 Thread Alex Gaynor
On Tue, Oct 26, 2010 at 9:31 PM, James Bennett wrote: > On Tue, Oct 26, 2010 at 7:23 PM, Alex Gaynor wrote: >> It depends what you mean by "MySQL" compatible.  If by that you mean >> that it's importable as mysqldb and implements the exact API it should >&g

Re: More efficient negative lookups

2010-10-27 Thread Alex Gaynor
On Wed, Oct 27, 2010 at 5:55 PM, Jacob Kaplan-Moss wrote: > On Wed, Oct 27, 2010 at 4:32 PM, Adrian Holovaty wrote: >> I'm inclined to say we do the former -- restore the "ne" lookup type >> -- because it's a quick fix, and ask somebody to write up a patch for >> the latter. Does anybody have str

Re: Google Code-in: any volunteers?

2010-10-28 Thread Alex Gaynor
Hey all, After speaking with Jacob I've put together our application. One of the components of which is having a list of tasks for students. The application is due tomorrow, so there isn't a ton of time, but I've started a wikipage where people can suggest ideas, so if you have anything that you

Re: Changing settings per test

2010-11-04 Thread Alex Gaynor
On Thu, Nov 4, 2010 at 3:46 PM, David Cramer wrote: > A common behavior I seem to have is the need to tweak the settings > object for certain test cases. The other case is that in many cases we > were (are?) relying on settings being configured a certain way for the > Django tests to even work. I

Re: Changing settings per test

2010-11-04 Thread Alex Gaynor
2010/11/4 Łukasz Rekucki : > Funny, I had exactly the same problem today at work while refactoring > my application's tests suite :). > > Currently, I'm using a pair of save/restore functions: save() monkey > patches the settings module and returns a dictionary of old values, > restore() puts back

Re: Changing settings per test

2010-11-04 Thread Alex Gaynor
On Thu, Nov 4, 2010 at 8:14 PM, Russell Keith-Magee wrote: > On Fri, Nov 5, 2010 at 3:46 AM, David Cramer wrote: >> A common behavior I seem to have is the need to tweak the settings >> object for certain test cases. The other case is that in many cases we >> were (are?) relying on settings being

Re: Call for review and comment: #7539 (ForeignKey on_delete)

2010-11-05 Thread Alex Gaynor
ilable as a github branch; the compare view [2] presents it nicely > as a diff with trunk. The patch is mostly the (excellent) work of > Johannes Dollinger, with some additional work by myself and Alex > Gaynor. > > Quick feature summary: the patch adds an on_delete argument t

Re: Documentation style guide hint for section headers?

2010-11-25 Thread Alex Gaynor
On Thu, Nov 25, 2010 at 2:25 PM, Adam V. wrote: > The docs seem a bit inconsistent on the use of raw lines for headings > that describe classes/methods/attributes. > > The stated preference is to use a directive before the heading to make > it easier to link. Is there also a preference on whether

Re: Broken .dates() method?

2010-11-26 Thread Alex Gaynor
On Fri, Nov 26, 2010 at 8:26 PM, Russell Keith-Magee wrote: > On Sat, Nov 27, 2010 at 9:23 AM, Russell Keith-Magee > wrote: >> On Sat, Nov 27, 2010 at 1:04 AM, Valentin Golev wrote: >>> Hello >>> >>> One of my projects which is running on trunk version of Django (not in >>> production, of course

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

2010-12-03 Thread Alex Gaynor
On Fri, Dec 3, 2010 at 10:56 PM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > Hi all, > > I've been looking at #14799, and trying to work out the best approach > for a solution. I can see three options, none of which are are > particularly attractive. I'm looking for feedback on which o

Re: Purpose of constant_time_compare?

2010-12-08 Thread Alex Gaynor
On Wed, Dec 8, 2010 at 3:08 PM, Jonas H. wrote: > 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* re

Re: question concerning the ModelChoiceIterator

2010-12-09 Thread Alex Gaynor
Because the assumption is that the QuerySet is going to be evaluated anyway (it's sort of in the class's name), so performing 2 queries would be wasteful. Alex On Thu, Dec 9, 2010 at 3:50 PM, bastir wrote: > Hey, > why is the __len__ funtion in ModelChoiceIterator implemented as > len(self.quer

Re: Fetching results of a query set

2010-12-11 Thread Alex Gaynor
On Sat, Dec 11, 2010 at 10:43 PM, Christophe Pettus wrote: > Hi, > > I've been spelunking through the 1.2.3 Model code, and wanted to see if > someone more familiar with that code than I could answer a question. > > In the case of returning the results of a query set, it appears that for > most ba

Re: Using asserts in test code

2010-12-24 Thread Alex Gaynor
On Fri, Dec 24, 2010 at 12:56 PM, Will Hardy wrote: > Maybe we could add a keyword argument to Django's TestCase.assert*() > methods that raises an AssertionError instead of failing the test when the > method's condition is not met (I assume that the test should error instead > of failing). > > e

Re: Using asserts in test code

2010-12-26 Thread Alex Gaynor
On Sun, Dec 26, 2010 at 9:55 PM, Will Hardy wrote: > It's true that there isn't any rich API for the Error/Fail distinction. The > best I can think of would be to create a custom exception eg > FailedAssumption, which is raised when the TestCase.failedException (same as > AssertionError) is caugh

Re: Question pertaining to availability of ``request`` throughout different scopes

2010-12-28 Thread Alex Gaynor
On Tue, Dec 28, 2010 at 11:59 PM, Yo-Yo Ma wrote: > Sorry, I did not mean a form. I meant a model's clean method. Normally > you could do something in a model by similar means as your example > though, but in the admin the only context where the request is > available is through admin actions. Pe

Re: Style guide for section headers in docs?

2011-01-01 Thread Alex Gaynor
On Sat, Jan 1, 2011 at 7:28 PM, Russell Keith-Magee wrote: > On Sunday, January 2, 2011, Adam V. wrote: > > The Django docs prefer "First word only" capitalization, though there > > are some cases where seemingly random words are also capitlized, > > "Views" in a couple headers here for instance

Re: Opinions on #15012 -- cache_page and TemplateResponse incompatibilities

2011-01-05 Thread Alex Gaynor
On Wed, Jan 5, 2011 at 5:41 PM, Florian Apolloner wrote: > Hi, > > On Jan 6, 12:02 am, Russell Keith-Magee > wrote: > > There are no backwards compatibility concerns here. We're talking > > about the class-based generic TemplateView. > > Sorry, I just noticed now, that the current function based

PSF Sponsored Sprints Initiative

2011-01-27 Thread Alex Gaynor
Hello Django Developers, On behalf of the Python Software Foundation’s sponsored sprint group, I wanted to drop your group a quick note introducing us. If you’re already familiar with our sponsored sprints, you’ll be happy to know we made a few changes to help both sprint groups and Python even mo

Re: settings.py should have way to hide key/values even when debug set True

2011-01-31 Thread Alex Gaynor
On Tue, Feb 1, 2011 at 1:25 AM, Matteius wrote: > I was thinking the decorator could apply to whatever setting is > declared directly following it. If declared, the setting simply > wouldn't show up. However I could add SECRET or PASSWORD to my token > sensitive settings just as well. > > On Ja

Re: Is Django cache.add atomic --AKA Free from race conditions?

2011-02-02 Thread Alex Gaynor
On Wed, Feb 2, 2011 at 5:55 PM, Matteius wrote: > If I have multiple requests hit the cache.add at the same time, is it > guaranteed that only one cache.add will return success (True) once and > all other requests are guaranteed to be failures, even in the case of > race conditions? > > cache.add

Re: Backwards Incompatible API Changes

2011-02-10 Thread Alex Gaynor
On Thu, Feb 10, 2011 at 5:14 PM, David Cramer wrote: > We're going to be deploying a backwards incompatible change to all > "since" values in the API. Any endpoint which accepts this parameter > to use as a form of range pagination will now include the value sent, > as well as values before or af

Re: Suggestion: a new "nature" field in Trac

2011-02-21 Thread Alex Gaynor
On Mon, Feb 21, 2011 at 6:36 PM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > On Tue, Feb 22, 2011 at 2:05 AM, Julien Phalip wrote: > > Hello, > > > > I was wondering if others would find it useful to introduce a new > > field in Trac to characterise the nature of a ticket, allowing to

Re: Delete cascade up for Inherited models

2011-02-22 Thread Alex Gaynor
On Wed, Feb 23, 2011 at 1:37 AM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > On Mon, Feb 21, 2011 at 1:56 PM, Rahul > wrote: > > When i ran the test cases ( "modeltests/delete/ > > test_inheritance_cascade_up" ) which were doing cascade up for > > inherited models, it failed for DB2 c

<    1   2   3   4   5   6   >