A better "manage.py shell" with syntax highlighting and multiline editing.

2014-10-13 Thread Jonathan S
Hi all, Two weeks ago I released the python-prompt-toolkit library with the "ptpython" REPL. That is a nice python interactive shell with decent multiline editing, syntax highlighting and autocompletion. For a list of all the features, see: http://github.com/jonathanslenders/python-prompt-toolk

Re: psycopg2 and Binary

2011-09-07 Thread Jonathan S
So, it works if I patch django.contrib.gis.db.backends.postgis.adapter. But that's obviously *not* the way to go... class PostGISAdapter(object): ... def getquoted(self): "Returns a properly quoted string for use in PostgreSQL/ PostGIS." # Want to use WKB, so wrap with psy

psycopg2 and Binary

2011-09-07 Thread Jonathan S
Hi django users, Not sure whether this is a bug or configuration issue. I have a postgres with postgis setup. It works perfect on a postgres 8.4 machine, but it doesn't on a postgres 9.1 machine. The problem is when constructing GIS queries. django.contrib.gis relies on psycopg2.Binary for encod

Re: Python Decorators

2011-04-06 Thread Jonathan S
Your code looks perfect. Following does print 'True'. def widget(widget_switch, as_string=False): def decorator(func): def wrapper(*args, **kwargs): # logic in here can access the value of 'widget_switch' but 'as_string' is not defined? print as_string

Re: how safe is the template engine

2010-10-18 Thread Jonathan S
Be careful, Don't forget that users will be able to execute random templatetags, which may be able to do read/write to the database as well. On 16 oct, 18:06, "Henrik Genssen" wrote: > Hi, > > can I safely use the template engine to produce user configured output? > If I use the template engine