o do this?
This should work:
response.__class__ = TestHttpResponse
-Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
Hi,
On Thu, Aug 27, 2009 at 07:42:24PM -0100, Joshua Russo wrote:
> On Thu, Aug 27, 2009 at 6:22 PM, Forest Bond
> wrote:
>
> Hi,
>
> On Thu, Aug 27, 2009 at 03:28:03PM -0100, Joshua Russo wrote:
> > On Thu, Aug 27, 2009 at 11:54 AM, Joshua Russo
>
eturn response
This only works for use cases where you have an on-disk file to serve. There
are plenty of situations where this may not be the case:
* Cloud storage services (e.g. Rackspace Cloud Files)
* Large data sets (e.g. data exports to CSV, XML)
Etc.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
et to deal with this issue and continue
development work there? The other tickets focus on specific symptoms of this
problem rather than the root cause more generally.
Any comments are appreciated.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
=== modifi
Hi,
On Mon, Feb 15, 2010 at 03:27:27PM -0600, Jeremy Dunck wrote:
> On Mon, Feb 15, 2010 at 3:16 PM, Forest Bond
> wrote:
> ...
> > * Forbid premature draining of the content iterator via response.content by
> > only
> > evaluating the content iterator if acce
w of the specific solution.
Okay, I'll create a ticket.
> Make sure you reference any other existing tickets, but don't close
> those tickets as duplicates - that way, if we find an alternate
> approach, we can close this new ticket as wontfix without losing the
> original problem reports.
Agreed.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
have to store a tuple of (blocks, data) in the first slot, that's not
> a huge runtime overhead, but it feels like a large code-complexity
> overhead for a very rare usecase (I had no idea memcached even had
> these limits, and I use it pretty extensively).
Such operations would also not be atomic. Concurrent attempts to update cache
would be problematic.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
leware to
> create a streaming response.
Okay, I think "disabled_middleware" is a bad name because it doesn't actually
imply that all middleware should be disabled. Anyway, it seems like middleware
could just check if isinstance(response, StreamingHttpResponse).
I look f
Hi,
On Sat, Feb 20, 2010 at 03:46:52PM -0500, Forest Bond wrote:
> Then there is the question of how to trigger handling as a streaming response.
> Either we require a view to explicitly request it by using a
> StreamingHttpResponse instead of a normal HttpResponse, or we assume that
Hi,
Sorry for the volume of messages, but I had one more note to add. ;)
On Sat, Feb 20, 2010 at 03:46:52PM -0500, Forest Bond wrote:
> Here are the use cases that have been identified:
>
> 1. A content iterator was passed for no apparent reason. The view could just
>as
Hi,
On Sun, Feb 21, 2010 at 01:28:23AM -0800, Tai Lee wrote:
> On Feb 21, 7:46 am, Forest Bond wrote:
> > Okay, I think "disabled_middleware" is a bad name because it doesn't
> > actually
> > imply that all middleware should be disabled. Anyway, it seems
way to do this, and I think that
capabilities ("can I do X") are only half of the picture (the other half being
"should I do X"), so even if response capabilities are known, middleware is
still going to have to infer a lot based on what headers are already set.
But if someone can come up with a use case where "has header bar?" and
isinstance(response, StreamingHTTPResponse) are insufficient and a
capabilities-style interface would work, I will gladly accept that interface.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
Hi,
On Mon, Feb 22, 2010 at 12:39:40AM +, Luke Plant wrote:
> On Sunday 21 February 2010 23:07:35 Forest Bond wrote:
>
> > Simply knowing whether or
> > not the response is streaming and whether or not it has a known
> > size is sufficient for knowing whether or
On Fri, Apr 06, 2007 at 03:17:41AM -, Django Code wrote:
> Parsing regexps is hardly dangerous. Let's keep some perspective.
Pardon my tone, I suppose "dangerous" might be a bit strong of a word.
> It is difficult and if you have a better way to do reverse matching, please
> post a patch.
On Fri, Apr 06, 2007 at 11:26:07PM +1000, Malcolm Tredinnick wrote:
> On Fri, 2007-04-06 at 09:08 -0400, Forest Bond wrote:
> > My point rests on the assumption that, no matter how good django gets at
> > parsing regular expressions, it will always be possible to write one that
>
Hi,
This is more-or-less a problem with Python's dict implementation, IMO. It's
really nothing more than a convenience thing, but for SortedDict, repr(d)
doesn't indicate the proper key order. It seems that the standard dict.repr
does not iterate over the dict like I would expect it to.
Attache
On Sun, Apr 08, 2007 at 12:16:00PM +0800, Russell Keith-Magee wrote:
> On 4/7/07, Forest Bond <[EMAIL PROTECTED]> wrote:
>
> > Attached is a patch that re-implements __repr__ using an iterator over the
> > object. Thus, SortedDict's are displayed properly in the
control over response handling. I think there are probably other
scenarios where easy WSGI integration would be beneficial, too.
For what it's worth...
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.rapidrollout.com
signature.asc
Description: Digital signature
ike to
get an idea of what chance it has of being accepted before I start working on
it. I am also happy to maintain it outside of Django svn for a while so that
people can test it out.
Feedback would be appreciated.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
ontent-Length' in response:
del response['Content-Length']
else:
response.content = compress_string(response.content)
response['Content-Length'] = str(len(response.content))
response['Content-Encoding'] = 'gzip'
return response
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
Hi,
Does anyone with commit access have a few minutes to look over the following
tickets?
* http://code.djangoproject.com/ticket/12979
* http://code.djangoproject.com/ticket/11557
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description
ow to use
> it.
That's a great idea. Probably step one then would be to write up some test
cases and make sure we all agree about those. Once I hear what people have to
say about the proposed API, I'll start on that.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
Hi,
I was re-reading this and wanted to clarify a few points.
On Mon, Sep 13, 2010 at 01:34:55PM -0400, Forest Bond wrote:
> Response Freezing
> =
>
> To address #1 and #2, I'd like to propose a response "freezing" API. The
> basic
> idea
ittle short on
time today.
For what it's worth, looking at the use cases again has been instructive and I
think the proposed API can be simplified some and still be able to address each
of them.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signat
response = HttpResponse(content = iterator)
response.streaming = True
# Prevent compression.
response.freeze_header('Content-Encoding')
return response
In either case, the response will be cached (although note that the cache
middleware will need to be modified to support caching streaming responses as
discussed above).
Are there use cases I've missed?
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
x27;s not a huge penalty for someone that really need streaming responses, I
wouldn't think. It also wouldn't take that much for the author of the 3rd party
middleware to implement the fix properly.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
to get the
> caching you want? Would that work?
I guess Cache-Control: private would mostly work, but even then proxy caches
would not cache the response. It'd still be an improvement.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
Hi,
On Wed, Dec 22, 2010 at 10:40:06PM -0600, James Bennett wrote:
> Tonight we've released Django 1.3 beta 1, as well as Django 1.2.4 and
> Django 1.1.3 to correct a pair of security issues.
FYI, the new releases have not been tagged in svn.
Thanks,
Forest
--
Fores
nd casting each object to the appropriate class based on the
> string value in this field.
>
> Does anyone know why this isn't available? Is there an equally
> efficient method of modeling this approach of which I am unaware?
I haven't used it, but maybe you should look into djan
Hi,
On Jun 11, 10:03 pm, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]>
wrote:
> * Must-haves: features that, if not completed, are worth delaying the
> release. That is, if the work on this list is not completed by a
> release date, we'll push the date.
I think that this is a must-have:
#285 --
On Jun 12, 8:51 am, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> On Thu, Jun 12, 2008 at 7:06 AM, Forest Bond <[EMAIL PROTECTED]> wrote:
> > I think that this is a must-have:
>
> > #285 -- WSGI SCRIPT_NAME and PATH_INFO stuff
>
> Then you'll
tually attach a patch (if we can agree on
what the syntax should look like).
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
Hi Russell,
On Mon, Jul 27, 2009 at 08:05:45AM +0800, Russell Keith-Magee wrote:
> On Sun, Jul 26, 2009 at 10:22 PM, Forest Bond
> wrote:
> > Hi,
> >
> > I have a simple implementation that allows filtering based on whether or
> > not a
> > particular row re
Hi Alex,
On Sun, Jul 26, 2009 at 08:42:26PM -0400, Alex Gaynor wrote:
> On Sun, Jul 26, 2009 at 8:05 PM, Russell
> Keith-Magee wrote:
> >
> > On Sun, Jul 26, 2009 at 10:22 PM, Forest Bond
> > wrote:
> >> Hi,
> >>
> >> I have a simple imple
ype of transaction when it is already in the database by
way of having a corresponding row in the sub-class's table.
-Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
Hi,
On Mon, Jul 27, 2009 at 04:50:17PM +0200, Honza Král wrote:
> On Mon, Jul 27, 2009 at 5:13 AM, Forest Bond
> wrote:
> > Hi Honza,
> >
> > On Mon, Jul 27, 2009 at 01:59:39AM +0200, Honza Král wrote:
> >> you can already do this yourself - just add a FK to Co
Hi,
On Mon, Jul 27, 2009 at 08:05:45AM +0800, Russell Keith-Magee wrote:
> On Sun, Jul 26, 2009 at 10:22 PM, Forest Bond
> wrote:
> > invoice_transactions = Transaction.objects.isa(Invoice)
> > payment_transactions = Transaction.objects.isa(Payment)
> >
&g
nction). Keeping HTTP-related logic in the view function itself
alleviates the need for a Http403 exception.
-Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
rrors in my practice
> don't work by this pattern so I don't propose making an exception for
> everything >= 400.
But your model code shouldn't have HTTP-related bits buried in it. That's a
layering violation. That code should raise a more generic exception th
u must set the foreign key fields to NULL manually before deleting.
-Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
signature.asc
Description: Digital signature
On Thu, May 31, 2007 at 09:16:07AM +1200, Robert Coup wrote:
> Ben Schwarze wrote:
> > Due to this process, I was looking for a way fetch a signal after the
> > creation of an object.
> > Currently Django has the pre_save and post_save signals that will be
> > send before and after saving the objec
Hi,
Currently, the regroup template tag returns a list of dicts that look something
like this:
[
{'grouper': 'thegrouper', 'list': [obj1, obj2, obj3]},
...
]
This is fine & correct behavior, and the tag works for both QuerySet's and lists
as inputs. However, if a QuerySet is passed in, it w
On Thu, Jun 07, 2007 at 10:38:52AM -0400, Forest Bond wrote:
> Hi,
>
> Currently, the regroup template tag returns a list of dicts that look
> something
> like this:
>
> [
> {'grouper': 'thegrouper', 'list': [obj1, obj2, obj3]},
>
On Thu, Jun 07, 2007 at 01:54:18PM -0700, Ilya Semenov wrote:
>
> > It also occurs to me that if regroup handled QuerySets as a special case,
> > large-ish datasets could be regrouped in a much more efficient manner,
> > since the
> > filter method could be used instead of iterating and testing f
On Thu, Jun 07, 2007 at 04:11:41PM -0500, Adrian Holovaty wrote:
> Aside from these very good reasons, it wouldn't be a good idea to
> couple the template system to the database layer. The template system
> shouldn't know anything about QuerySets, or Models, or Managers, or
> any other Django-model
On Wed, Jun 27, 2007 at 02:41:15PM -, Donny wrote:
>
> On Jun 26, 11:28 am, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> > The biggest hurdle to dbsettings at this point is that it caches
> > settings in a standard Python module, which only exists within a
> > single process. This was all well
Hi,
I was trying to set up a site at a URL that is not at the root of the web
server. I am using mod_python, and my apache config looks similar to that
included with the relevant django documentation, which I'll duplicate here:
[from http://www.djangoproject.com/documentation/modpython/]
--
On Tue, Jul 10, 2007 at 04:13:44PM -0400, Max Battcher wrote:
>
> On 7/10/07, Forest Bond <[EMAIL PROTECTED]> wrote:
> > So, the problem is that I have to update my urls.py to include the /mysite/
> > prefix in all URLs.
> >
> > ...
> >
> > If thi
On Tue, Jul 10, 2007 at 04:25:17PM -0400, Marty Alchin wrote:
>
> On 7/10/07, Forest Bond <[EMAIL PROTECTED]> wrote:
> > All of this could be fixed by simply changing ModPythonRequest
> > (django/core/handlers/modpython.py) to use req.path_info instead of req.uri.
> &
On Tue, Jul 10, 2007 at 09:40:49PM -, [EMAIL PROTECTED] wrote:
> On Jul 10, 5:02 pm, Forest Bond <[EMAIL PROTECTED]> wrote:
> > Is this kind of change relevant for all of the other methods? I have not
> > used
> > any of the others. Certainly, if a change l
On Wed, Jul 11, 2007 at 09:12:14AM -0500, Jacob Kaplan-Moss wrote:
> Probably the best way to host an "unofficial" branch would be by using
> Tom's Mercurial mirror of Django trunk:
> http://hg.korpios.com/django.trunk/.
Since you're on svn, you might also try svk.
-Forest
signature.asc
Descrip
On Wed, Jul 11, 2007 at 09:43:15PM +0700, Ben Ford wrote:
> I'm already happily using SVK, and was originally planning to use it to
> remotely host the multi-db branch on my virtual server... However the only
> info
> I could find on achieving this was incorrect and I'm not sure if it is even
> po
On Wed, Jul 11, 2007 at 09:27:43PM -, [EMAIL PROTECTED] wrote:
>
> This snippit replaces the request.path. My question is, how does this
> work with sitemap, absolute rul's and reverse url lookups? doesn't it
> break all of those, or am I missing something?
More importantly (for me), this sni
On Thu, Jul 12, 2007 at 08:45:33AM +0700, Yuri Baburov wrote:
> Can't do experiments now, but my admin interface (django trunk) began
> to work right after this middleware addition, that meant reverse url
> were resolved somehow.
> Snippet exactly change req.uri to req.script_name+req.uri, that giv
On Sat, Jul 14, 2007 at 05:19:57PM -0700, Brian Harring wrote:
> On Fri, Jul 13, 2007 at 11:28:27PM -0500, Gary Wilson wrote:
> >
> > Brian Harring wrote:
> > > On Wed, Jul 11, 2007 at 09:38:54AM -0500, Deryck Hodge wrote:
> > >> For example:
> > >>
> > >> mkdir repos
> > >> cd repos
> > >> bzr in
On Mon, Jul 16, 2007 at 09:24:07AM -0700, David Cramer wrote:
>
> Is there a specific reason that myfield=None doesn't translate to
> myfield__isnull=True in the database backend?
myfield = None translates into the SQL expression myfield = NULL. This is not
really that useful, since that clause
it does keep
"foo = NULL" in the realm of producable SQL expressions, while making the common
case "foo = None" a little more intuitive for Python folks.
It may not be that great an idea, either.
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
27;t want to pay
someone else to do it, do it yourself.
It's the other part (which constitutes advice that Schwarzenegger himself might
have offered) that you seem to have missed: stop whining and write some code.
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
zealot answer" would include reference to
Schwarzenneger. :)
None-the-less, I apologize for misinterpreting what appeared to me to be a
sneering jab at open source, amounting to little more than biting the hand that
feeds (independent of what was being offered).
Sorry, mamcx.
-Forest
--
Forest B
, though, how many special-purpose package management systems do we
need?
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
:
svn diff
You don't need write access to the subversion repository to do this.
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
just... *sick*.
No, that's just meta-programming, bash-style ;)
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
ew backend and db config.
You might have a name collision with your settings file and another critical
module somewhere. Perhaps you should rename your settings file to testmssql.py?
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
jango/oldforms/__init__.py", line 29
> raise KeyError, "Field %s not found\n%s" % (field_name, repr(self.fields))
> ^
> SyntaxError: invalid syntax
>
> Yeah, it's gonna be a long road...
Well, these SyntaxError's are easily corrected using the automated code
conversion too, I think. The road may not be unbearably long. These just need
parentheses:
raise MyError(arg1, arg2)
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
t seems unlikely, of course.
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
= value(self, *args, **kwargs)
send_postsave_signal()
return retval
return save
retun value
----
This adds some overhead, of course, but it does do (roughly) what is being
asked.
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
Hi,
> On Nov 14, 2007 9:37 AM, Forest Bond <[EMAIL PROTECTED]> wrote:
> > This is neat and all, but I don't think at actually solves the problem at
> > hand.
> > If save is not overridden, when does queue.dispatch() get called?
>
> If save isn't over
Hi,
On Fri, Nov 30, 2007 at 08:12:14AM -0600, Malcolm Tredinnick wrote:
> On Fri, 2007-11-30 at 08:33 -0500, Forest Bond wrote:
> > On Fri, Nov 30, 2007 at 12:33:31AM -0600, Adrian Holovaty wrote:
> > > * #285 -- WSGI SCRIPT_NAME and PATH_INFO stuff
> >
> > Aren
changing .py files at all. Or was this resolved when I wasn't looking?
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
should have to
indicate that, right? Is this not a reasonable way to do that?
objects = list(MyModel.objects.filter(site=1))
first_one = objects[0]
Maybe another method would make that read nicer:
objects = MyModel.objects.filter(site=1).fetch()
first_one = objects[0]
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
Hi,
Replying to self.
On Tue, Dec 04, 2007 at 11:25:42AM -0500, Forest Bond wrote:
> objects = MyModel.objects.filter(site=1).fetch()
> first_one = objects[0]
Incidentally, qs.fetch() need not be equivalent to list(qs). It could just
trigger qs to cache the results of the query and ret
Hi,
On Fri, Dec 07, 2007 at 07:25:03PM +1100, Malcolm Tredinnick wrote:
> (or stop using app_loader, which is something I've been tending towards more
> and more lately).
And how does one do that?
-Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Descripti
Hi,
On Fri, Dec 07, 2007 at 10:56:09AM -0500, Empty wrote:
> On Dec 7, 2007 7:09 AM, Forest Bond <[EMAIL PROTECTED]> wrote:
> > On Fri, Dec 07, 2007 at 07:25:03PM +1100, Malcolm Tredinnick wrote:
> > > (or stop using app_loader, which is something I've been tendin
/wiki/BackwardsIncompatibleChanges. I didn't
feel authoritative enough on the subject to add it myself.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
signature.asc
Description: Digital signature
74 matches
Mail list logo