Re: Multi-DB support within transaction middleware

2011-11-12 Thread Calvin Spealman
I'm not sure this is so cut and dry. For two reasons: 1) If a project has a lot of databases configured, created and ending a transaction in all of them for every request/response cycle could get expensive, and following that: 2) This is enough of a change in behavior that it shouldn't just be

Re: Django git guidelines

2012-05-18 Thread Calvin Spealman
On May 18, 2012 4:43 AM, "Anssi Kääriäinen" wrote: > > A heads up: I am working on Git and Github usage guidelines. There is > a ticket https://code.djangoproject.com/ticket/18307, and I have a > github branch with some initial work https://github.com/akaariai/django/tree/django_git_guidelines > (

Re: Django git guidelines

2012-05-18 Thread Calvin Spealman
On Fri, May 18, 2012 at 7:38 AM, Anssi Kääriäinen wrote: > On May 18, 1:44 pm, Calvin Spealman wrote: >> >  - When upstream has changed use git rebase instead of git pull >> >> A rebase workflow has always been problematic, in my experience. It will >> cause prev

Re: Re-design "proposal" for djangoproject.com

2012-05-20 Thread Calvin Spealman
On Sun, May 20, 2012 at 4:05 PM, Horst Gutmann wrote: > On Sat, May 19, 2012 at 6:06 PM, Giovanni Collazo wrote: >> Hi, >> >> So, I spend a few hours working on the re-design following Idan's >> Guidelines. Any feedback and further direction from the core team would be >> greatly appreciated. >>

Re: Model inheritance extended.

2012-09-25 Thread Calvin Spealman
On Mon, Sep 24, 2012 at 9:55 AM, Jonathan Slenders wrote: > Hi everyone, > > This may be interesting to some of you. I created a small library for > inheritance of a set of models. > It's best to go quickly through the Readme on the site below. > > We felt a need for this, but I'm wondering whethe

Re: Proposal for simplifying part of the GCBV API slightly.

2013-04-22 Thread Calvin Spealman
On Apr 22, 2013 7:15 AM, "Tom Christie" wrote: > > I'd be interested to know what you folks think of this proposal. > > SingleObjectMixin currently exposes these three attributes and one method all dealing with queryset filter arguments... > > * pk_url_kwarg = 'pk' > * slug_field = 'slug' > * slug

Re: Default project layout / directory structure

2011-03-17 Thread Calvin Spealman
-1 On django manipulating PYTHONPATH +1 On encouraging people to keep their applications out of their project! On Thu, Mar 17, 2011 at 1: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/

Re: Proposal: switch to HTML5 for bundled templates

2011-03-28 Thread Calvin Spealman
+1 No harm, as it breaks nothing currently using the templates. Sets a great message that Django moves forward. I like it. On Mon, Mar 28, 2011 at 12:38 PM, Luke Plant wrote: > Hi all, > > I'd like to put forward the proposal that we switch to HTML5 for all > Django supplied templates in Django

Re: Allow disabling choices in a

2011-06-03 Thread Calvin Spealman
On Fri, Jun 3, 2011 at 12:50 PM, Jody McIntyre wrote: > We need to be able to disable choices in a , which is done by > setting the disabled attribute on the tag, for example: > Bananas > >  Currently we're doing this by subclassing the Select widget: > http://djangosnippets.org/snippets/2453/ >

Re: Allow disabling choices in a

2011-06-03 Thread Calvin Spealman
On Fri, Jun 3, 2011 at 3:00 PM, Jody McIntyre wrote: > On Fri, Jun 3, 2011 at 1:09 PM, Calvin Spealman > wrote: >> >> > 1. Backwards compatibility is already addressed.  If the widget is >> > passed a >> > regular "choices" field, the existing

Re: Django test documentation example not respecting xUnit convention

2011-09-20 Thread Calvin Spealman
On Sep 20, 2011 5:18 AM, "James Pic" wrote: > > Hello everybody, > > Sorry if this topic has already been brought, I asked about it on IRC but nobody answered. > > Being a old user of xUnit patterns in several languages, i just figured that there might be a mistake in django testing documentation

Re: Feature proposal: Q.push(...) and QuerySet.filter(relfield=Q(...))

2011-09-30 Thread Calvin Spealman
On Fri, Sep 30, 2011 at 5:37 PM, Johannes Dollinger wrote: > The aim of this proposal is to reuse Q objects for models that are related > through FK or M2M fields. > A simplified example would be a Q object like > >    >>> is_blue = Q(blue=True) >    >>> Thing.objects.filter(is_blue) > > that sho

assigning to model properties for mocking

2008-10-21 Thread Calvin Spealman
I'm trying to build a test suite in my project and I'm making heavy use of mocks to write them cleanly. Testing has reached a point where I need to mock the fkey property of a model instance, but I'd really like to use this as a mock. Of course, I can't assign the mock here because it isn't an ins

Re: assigning to model properties for mocking

2008-10-23 Thread Calvin Spealman
On Wed, Oct 22, 2008 at 4:14 AM, Malcolm Tredinnick < [EMAIL PROTECTED]> wrote: > > > On Tue, 2008-10-21 at 18:55 -0700, Calvin Spealman wrote: > > I'm trying to build a test suite in my project and I'm making heavy > > use of mocks to write them cleanly. Te

Re: assigning to model properties for mocking

2008-10-25 Thread Calvin Spealman
Thanks for all the input and response everyone. On Thu, Oct 23, 2008 at 8:00 PM, Malcolm Tredinnick < [EMAIL PROTECTED]> wrote: > > > On Thu, 2008-10-23 at 05:49 -0400, Calvin Spealman wrote: > > On Wed, Oct 22, 2008 at 4:14 AM, Malcolm Tredinnick > >

Re: Alternate ForeignKey based on choices

2008-10-26 Thread Calvin Spealman
You could also have a common parent class for Robot and User, and use that as your foreign key type. Which type is referenced would be your determination of user type. On Sun, Oct 26, 2008 at 6:19 AM, CooLMaN <[EMAIL PROTECTED]> wrote: > > Hello, > > I have an application with a model similar to

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-28 Thread Calvin Spealman
On Tue, Oct 28, 2008 at 8:18 PM, oggie rob <[EMAIL PROTECTED]> wrote: > > > {% for item in grocery_list %} > > {{ item }} > > {% default %} > > Nothing to buy. > > {% endfor %} > > Please, though - use {% else %}. Its totally clear what its referring > to and else doesn't mean squat unless yo

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Calvin Spealman
ed Batchelder <[EMAIL PROTECTED]>wrote: > But this does operate the same as the Python for/else, no? > > >>> for i in []: > ... print "boo" > ... else: > ... print "foo" > ... > foo > >>> > > --Ned. > http://n

Re: Proposal: Optional {% default %} clause for the {% for %} template tag

2008-10-29 Thread Calvin Spealman
1 for else The template language may not be sold as "python in html" but there are still obvious relationships between the constructs the two share. Breaking assumptions then simply isn't good for anyone involved. +1 for a default, -1 for calling it else > On Wed, Oct 29, 2008 at 5:4

Re: Proposal: Do not use global settings.py when running unit tests

2008-11-03 Thread Calvin Spealman
+1 On Mon, Nov 3, 2008 at 3:24 AM, Siddhi <[EMAIL PROTECTED]> wrote: > > So here is the situation: > > I have a middleware installed that looks at the HTTP_HOST header and > stores the domain and subdomain into the request object. Now when > running unit tests, the tests fail because the HTTP_HOS

Re: Multi-Threaded Dev Server

2008-11-15 Thread Calvin Spealman
Does it need to be multi-threaded? Can you get a multi-process dev server instead/also? On Sun, Nov 16, 2008 at 1:26 AM, Chris <[EMAIL PROTECTED]> wrote: > > I think http://code.djangoproject.com/ticket/3357 should be given > another look at enabling optional multi-threading on the dev server. >

Re: Multi-Threaded Dev Server

2008-11-17 Thread Calvin Spealman
The last thing new people need when they come in and start playing around with the dev server is to worry about all the issues that can come up with threading. I would never recommend to anyone who doesn't really know what they're doing and anyone who does can easily use any one of the number of s

Caching over 1MB

2008-12-07 Thread Calvin Spealman
Using the caching api backed by memcache, i started hitting the 1MB object size limit of memcache and I was thinking of a way around it by storing a list of keys to segments of the full object, each up to 1MB each. I figure this will raise the limit to 15GB and that had better be large enough for

Queries for instances with subclasses?

2009-02-26 Thread Calvin Spealman
I'm looking for the best way to query based on the existence of an instance of a subclass. In my case, there are Actions that have several subclasses, like FriendRequest, PhotosTagged, etc. The user has selected a set of types they are interested in, so I need to query for all the actions that are

Re: Queries for instances with subclasses?

2009-02-27 Thread Calvin Spealman
On Fri, Feb 27, 2009 at 1:31 AM, Malcolm Tredinnick wrote: > > On Thu, 2009-02-26 at 11:08 -0500, Calvin Spealman wrote: >> I'm looking for the best way to query based on the existence of an >> instance of a subclass. In my case, there are Actions that have >

Re: Queries for instances with subclasses?

2009-02-27 Thread Calvin Spealman
consideration. > On 27 Feb, 14:13, Calvin Spealman wrote: >> On Fri, Feb 27, 2009 at 1:31 AM, Malcolm Tredinnick >> >> >> >> wrote: >> >> > On Thu, 2009-02-26 at 11:08 -0500, Calvin Spealman wrote: >> >> I'm looking for the best