Re: Escaping in templates...

2007-04-18 Thread SmileyChris
On Apr 19, 1:36 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Since this is actually a good idea, we should give credit where it's > due: the whole theory behind this (and most of the details) is Simon > Willison's creation. I just wrote the code and polished off some of the > less smooth co

Re: Type coercion in Django

2007-04-18 Thread Robert Coup
Justin Bronn wrote: > >From GEOSGeometry it is simple to retrieve WKT and HEX, e.g., 'g.wkt' > or 'g.hex'. However, KML is implemented by PostGIS and can only be > retrieved if you do "SELECT AsKML(the_geom)" on the database end. > Further, GML (ancestor to KML, another OGC standard) and SVG can

Re: Type coercion in Django

2007-04-18 Thread Justin Bronn
> How do you handle data input of GIS types? What format is used during > assignment? During assignment, PostGIS returns in a format called HEXEWKB (hereinafter "HEX"), one of its 'canonical forms'. Essentially it's a hexadecimal string of the binary format (WKB, an OGC standard). For input you

Re: Escaping in templates...

2007-04-18 Thread Malcolm Tredinnick
On Wed, 2007-04-18 at 08:58 +, SmileyChris wrote: [...] > I actually like Malcom's proposal. Can't say I'd be thrilled if it was > on by default though. Since this is actually a good idea, we should give credit where it's due: the whole theory behind this (and most of the details) is Simon Wi

Re: Resize images on demand

2007-04-18 Thread Jacob Kaplan-Moss
On 4/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Would you consider adding a thumbnail capability to Django? I know > there are contributions out there that do it and the dependency on PIL > might be a negative but I believe this is a very common use case. How > many apps have an image

Re: Resize images on demand

2007-04-18 Thread [EMAIL PROTECTED]
Just a question out to the developers- Would you consider adding a thumbnail capability to Django? I know there are contributions out there that do it and the dependency on PIL might be a negative but I believe this is a very common use case. How many apps have an image field and don't use some

Re: Type coercion in Django

2007-04-18 Thread Robert Coup
Russell Keith-Magee wrote: > On 4/19/07, jbronn <[EMAIL PROTECTED]> wrote: > >> The GIS branch (GeoDjango) is interested in type coercion. >> Specifically, PostGIS returns geometries as hex strings to the client >> -- it would be preferable to have this come into the model as either a >> differ

Re: Buildbot?

2007-04-18 Thread Jacob Kaplan-Moss
On 4/18/07, Brian Harring <[EMAIL PROTECTED]> wrote: > What exactly was the issue you were having? Ofhand, a ShellCommand > with haltOnFailure=True ought to suffice- last I looked, y'alls test > runner properly set the exit code if a failure was detected, thus you > should be able to rely on that

Re: Buildbot?

2007-04-18 Thread Jacob Kaplan-Moss
On 4/18/07, Matthew Flanagan <[EMAIL PROTECTED]> wrote: > The script [1] I'm using for the Django pybots [2] is very simple. The > only thing I'd like to get going is testing against different > backends. Do you have a problem with running it on pybots, except for > the fact it isn't testing again

Re: Type coercion in Django

2007-04-18 Thread Russell Keith-Magee
On 4/19/07, jbronn <[EMAIL PROTECTED]> wrote: > > The GIS branch (GeoDjango) is interested in type coercion. > Specifically, PostGIS returns geometries as hex strings to the client > -- it would be preferable to have this come into the model as either a > different type of string like WKT ("POLYGO

Re: Buildbot?

2007-04-18 Thread Matthew Flanagan
On 4/19/07, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > On 4/18/07, Jonathan Daugherty <[EMAIL PROTECTED]> wrote: > > Do you have a resident buildbot? That could be used to run the > > regression tests on (all pythons) x (all databases). It would still > > take time, of course, but it could

Re: Type coercion in Django

2007-04-18 Thread Russell Keith-Magee
On 4/18/07, Gulopine <[EMAIL PROTECTED]> wrote: > > On Apr 17, 9:03 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> > wrote: > I don't know what > other field types there might be in the future, but it seems like a > stretch to think that it's unnecessary just because I can't anticipate > other spec

Re: Buildbot?

2007-04-18 Thread Brian Harring
On Wed, Apr 18, 2007 at 11:16:56AM -0500, Jacob Kaplan-Moss wrote: > > On 4/18/07, Jonathan Daugherty <[EMAIL PROTECTED]> wrote: > > Do you have a resident buildbot? That could be used to run the > > regression tests on (all pythons) x (all databases). It would still > > take time, of course, bu

Re: Escaping in templates...

2007-04-18 Thread SmileyChris
Thinking about it more, I wouldn't actually be against Malcom's autoescaping solution being on by default - I do see the importance of solid XSS protection! I can also see a solution which would maintain backwards compatibility for old sites: TEMPLATE_AUTOESCAPE=False in conf.global_settings TEMP

Re: A shortcut for django.core.urlresolvers.reverse

2007-04-18 Thread Matt
On 18 Apr, 23:05, SmileyChris <[EMAIL PROTECTED]> wrote: > I'm not sure this is really adding that much. Why can't you just use > reverse as it stands? It doesn't seem hard to do: > >>> some_id = 1 > >>> reverse(some_view, kwargs=dict(id=some_id)) > '/event/1/' > or: > >>> reverse(

Re: GeoDjango query with foreign keys

2007-04-18 Thread jbronn
Matt, That's a good point you brought up: if there's a ForeignKey to a model with a geographic field, then the model with the ForeignKey requires GeoManager to construct geographic queries on related objects (even if the model itself does not have geographic fields). The GeoManager overrides the

Re: Type coercion in Django

2007-04-18 Thread jbronn
> Coercion of the type you describe is not required for any field > currently supported. I would be hesitant to include coercion as a core > part of the framework unless there is a generic need to coerce > database values into Python values in some way other than that > performed by the database b

Re: A shortcut for django.core.urlresolvers.reverse

2007-04-18 Thread SmileyChris
I'm not sure this is really adding that much. Why can't you just use reverse as it stands? It doesn't seem hard to do: >>> some_id = 1 >>> reverse(some_view, kwargs=dict(id=some_id)) '/event/1/' or: >>> reverse(some_view, args=[some_id]) '/event/1/' --~--~-~--~~--

Re: The locmem patch and development progress

2007-04-18 Thread Daniel Brandt
On 4/18/07, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > On 4/18/07, Daniel Brandt <[EMAIL PROTECTED]> wrote: > > Something has been bugging me for a while.. > > This type of complaint seems to come up every few months. I'm always tempted > to > ignore it because I have a hard time responding

Re: A shortcut for django.core.urlresolvers.reverse

2007-04-18 Thread Ivan Sagalaev
Matt Riggott wrote: > from django.core.urlresolvers import reverse > > def absolute_url(viewname, *args, **kwargs): > return reverse(viewname, args=args or [], kwargs=kwargs or {}) As far as I can tell you don't need 'or []' and 'or {}' since they will be [] and {} already when

Re: Escaping in templates...

2007-04-18 Thread Armin Ronacher
Hoi, Another small notice. Pylons and other frameworks thought about implementing "__html__" for objects that return an html representation of the object. If there is none it's converted to unicode and escaped. Adding something like "__html__ = lambda s: s" to the escaped string base classes coul

Re: Type coercion in Django

2007-04-18 Thread Gulopine
A little more research shows that I could also accomplish what I'm looking for by tying into the pre_init or post_init signal, but then I'd need a customized function for each field that needs processing, on each model. This could be done, of course, and it would certainly keep this coercion out o

A shortcut for django.core.urlresolvers.reverse

2007-04-18 Thread Matt Riggott
Hi folks, Something I find myself writing for each new Django project is a small wrapper for the django.core.urlresolvers.reverse function. It usually looks something like this: from django.core.urlresolvers import reverse def absolute_url(viewname, *args, **kwargs): return reve

Buildbot?

2007-04-18 Thread Jacob Kaplan-Moss
On 4/18/07, Jonathan Daugherty <[EMAIL PROTECTED]> wrote: > Do you have a resident buildbot? That could be used to run the > regression tests on (all pythons) x (all databases). It would still > take time, of course, but it could at least be automated[1][2]. I've spent some time in the past try

Re: The locmem patch and development progress

2007-04-18 Thread Michael Radziej
On Wed, Apr 18, Jonathan Daugherty wrote: > > # 7. Run the regression tests against every supported version of Python > #with every database backend available. > > Do you have a resident buildbot? That could be used to run the > regression tests on (all pythons) x (all databases).

Re: The locmem patch and development progress

2007-04-18 Thread Nicola Larosa
Jacob Kaplan-Moss wrote: > I've filed tickets and bugs against many other projects, and as you > might expect the results run the gamut from "fuck you"[1] to being > checked in instantly. > ... > [1] No prizes for guessing which project this was. I'll have a shot anyway: RoR? ;-} http://www.fl

Re: Resize images on demand

2007-04-18 Thread Michel Thadeu Sabchuk
Hi Ok, sorry about that Jacob! Thanks for pointing me at right place! Best Regards, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers

Re: The locmem patch and development progress

2007-04-18 Thread Jonathan Daugherty
# 7. Run the regression tests against every supported version of Python #with every database backend available. Do you have a resident buildbot? That could be used to run the regression tests on (all pythons) x (all databases). It would still take time, of course, but it could at le

Re: The locmem patch and development progress

2007-04-18 Thread Jacob Kaplan-Moss
On 4/18/07, Daniel Brandt <[EMAIL PROTECTED]> wrote: > Something has been bugging me for a while.. This type of complaint seems to come up every few months. I'm always tempted to ignore it because I have a hard time responding in a way that doesn't end up making me sound like a dick; usually that

Re: unicode-branch: string handling

2007-04-18 Thread Ivan Sagalaev
Michael Radziej wrote: > gettext('blablabla %s blablalba') % \ > "utf8 bytestring with funny รครค chars" > > If gettext returned unicode, python would decode the utf8 encoded > bytestring, again using ASCII as default encoding -> exception galore ;-) I believe we should teach people to start usi

Re: Type coercion in Django

2007-04-18 Thread Gulopine
On Apr 17, 9:03 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > Coercion of the type you describe is not required for any field > currently supported. I would be hesitant to include coercion as a core > part of the framework unless there is a generic need to coerce > database values into Py

Re: The locmem patch and development progress

2007-04-18 Thread Michael Radziej
On Wed, Apr 18, Daniel Brandt wrote: > > Something has been bugging me for a while.. > > Check out http://code.djangoproject.com/ticket/3012 for a pretty > critical patch to the locmem cache backend. The patch is accepted and > ready for checkin, and more than two weeks have passed since. The b

Re: Type coercion in Django

2007-04-18 Thread Gulopine
On Apr 17, 9:03 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > Coercion of the type you describe is not required for any field > currently supported. I would be hesitant to include coercion as a core > part of the framework unless there is a generic need to coerce > database values into Py

Re: Escaping in templates...

2007-04-18 Thread Michael Radziej
Hi Chris, On Wed, Apr 18, SmileyChris wrote: > > On Apr 18, 3:48 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > > In the past threads, we basically had consensus anyway, I'm not sure > > that revisiting everything again is worth the hassle. > > Without trying to rock the boat... reading

The locmem patch and development progress

2007-04-18 Thread Daniel Brandt
Something has been bugging me for a while.. Check out http://code.djangoproject.com/ticket/3012 for a pretty critical patch to the locmem cache backend. The patch is accepted and ready for checkin, and more than two weeks have passed since. The bug itself was filed in february. What am I missing

Re: Escaping in templates...

2007-04-18 Thread SmileyChris
On Apr 18, 3:48 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > In the past threads, we basically had consensus anyway, I'm not sure > that revisiting everything again is worth the hassle. Without trying to rock the boat... reading back, I'm not sure there was a resounding consensus. I actua

Re: Escaping in templates...

2007-04-18 Thread SmileyChris
On Apr 18, 3:48 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Unfortunately, the AutoEscapingAlternative page uses strawmen to try and > make its arguments. Ok, it's less "controversial" now. --~--~-~--~~~---~--~~ You received this message because you are su