[JOBS - NYC] Python / Django developer for WNYC, New York Public Radio

2012-05-04 Thread Jeff Heard
This is not mine, so I can't give *all* the details, but I was asked to forward this along. It's a good gig - great people, offices in SoHo, growing organization within a 100+ year old mainstay of New York City, https://jobs-wnyc.icims.com/jobs/1116/job -- You received this message because you

Re: Confused about GeoDjango and PostGIS

2012-04-25 Thread Jeff Heard
It can. I just usually consider it easier to create a new one On Apr 25, 2012 1:38 PM, "vishy" wrote: > So, the existing database cannot be used as a postgis db? > > On Apr 25, 9:21 pm, Jeff Heard wrote: > > Create a new spatial database and import the data. That&

Re: Confused about GeoDjango and PostGIS

2012-04-25 Thread Jeff Heard
Create a new spatial database and import the data. That's by far your easiest option. You'll need to create a POINT column (look at the PostGIS doc on how to add spatial columns) and then add rows either using the ORM or with a spatial query including something like this as part of the insert: G

Re: PostgreSQL Socket 5432 Error

2012-04-19 Thread Jeff Heard
The other possibility is that you need to build psycopg2 from scratch and set the pg_config option in setup.cfg. I have to do this with the brew build of pg because the socket is elsewhere On Apr 19, 2012, at 7:32 PM, Russell Keith-Magee wrote: > On Friday, 20 April 2012 at 6:04 AM, Zach wr

Re: Dynamically generated models using exec. Is it too custly?

2012-04-16 Thread Jeff Heard
Check https://github.com/JeffHeard/ga_dynamic_models. It may be similar to what you're looking for. Even if you don't want the code, you can see a way of dynamically generating models. On Mon, Apr 16, 2012 at 12:40 PM, Philip Mountifield < pmountifi...@formac.net> wrote: > Did you know that yo

Re: svm python

2012-03-30 Thread Jeff Heard
Look in Orange. http://orange.biolab.si/ On Mar 30, 2012, at 2:23 AM, dummyman dummyman wrote: > Is any one aware of svm implementation using python ? > Apart from using weka tool ? > > > On Thu, Mar 29, 2012 at 9:21 AM, dummyman dummyman wrote: > Hi, > > I am looking for svm classifier i

Re: ANNOUNCE: Django 1.4 released

2012-03-23 Thread Jeff Heard
Do the PyCharm devs read this list? Will 1.4 work inside pycharm 2.5? On Mar 23, 2012, at 3:58 PM, Mário Neto wrote: > Great! \,,/_ > > 2012/3/23 James Bennett > Django 1.4 is finally here! > > For details, checkout the weblog: > > https://www.djangoproject.com/weblog/2012/mar/23/14/ > >

Re: Weird stacktrace coming from manage.py test

2012-03-23 Thread Jeff Heard
No, it turned out that my django-startproject.py was still the one for 1.3... On Fri, Mar 23, 2012 at 10:47 AM, Reinout van Rees wrote: > On 22-03-12 17:34, Jeff Heard wrote: >> >> Has anyone seen this before?  Am I missing something?  This hasn't even >> gotten to my

Django-1.4c2 logging issue on Snow Leopard

2012-03-22 Thread Jeff Heard
Hi all. I just created a new Django-1.4 project and got this error: Traceback (most recent call last): File "manage.py", line 14, in execute_manager(settings) File "/Users/jeffersonheard/Source/geoanalytics/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in exe

Weird stacktrace coming from manage.py test

2012-03-22 Thread Jeff Heard
Has anyone seen this before? Am I missing something? This hasn't even gotten to my code yet. I'm using this in my settings.py: TEST_RUNNER = 'django.contrib.gis.tests.GeoDjangoTestSuiteRunner' I have a template PostGIS database setup properly. And I'm running the stable release of Django 1.3.

Re: Caching and model import question

2012-03-21 Thread Jeff Heard
Well, I was wrong... how *should* this work? I tried a signal handler to reload modules whenever someone added or deleted a model, but that only seems to matter if a particular module that loads "models" hasn't been loaded yet. On Wed, Mar 21, 2012 at 12:59 PM, Jeff Heard wrot

Re: Caching and model import question

2012-03-21 Thread Jeff Heard
r couple of iterations on it may make sense. On Wed, Mar 21, 2012 at 12:52 PM, Tom Evans wrote: > On Wed, Mar 21, 2012 at 4:19 PM, Jeff Heard > wrote: >> Question 1: Would this work with views, or for that matter, anything >> else in Django, assuming you&#x

Caching and model import question

2012-03-21 Thread Jeff Heard
Question 1: Would this work with views, or for that matter, anything else in Django, assuming you're using a WSGI server like gunicorn? http://code.activestate.com/recipes/578078/  Specifically, will it cache across HTTP requests, or not? I guess the one thing I don't understand well in Django is

Caching and module import question

2012-03-19 Thread Jeff Heard
Question 1: Would this work with views, or for that matter, anything else in Django, assuming you're using a WSGI server like gunicorn? http://code.activestate.com/recipes/578078/ Specifically, will it cache across HTTP requests, or not? I guess the one thing I don't understand well in Django is

Re: psycopg2, postgres9.1, Mac OS - problem with psycopg2

2012-02-22 Thread Jeff Heard
Just as a followup to this, there are a few problems that have been patched on Django with regards to Postgres 9.1. They're not in the stable release, but if you're using custom binary fields, such as PostGIS geometry, you will need to search for the patch and apply it. You may see '\x00' is not

Re: Newbie django/python with C++ background wants enums

2012-02-01 Thread Jeff Heard
*slightly* better would be: class X(models.Model): YES='Y' NO='N' DEFAULT='D' TO_USE = ((X.YES, "Yes"), (X.NO, "No"), (X.DEFAULT, "Default")) txt= models.CharField(db_index=True,null=True, blank=True,max_length=30) use_txt= models.CharField(blank=False,max_length=1,default

Re: ANN: OGC Web Feature Service for GeoDjango

2012-02-01 Thread Jeff Heard
Great. There's more coming down the pipe. WFS was the first thing I had reasonably finished... On Tue, Jan 31, 2012 at 10:16 AM, George Silva wrote: > Wow! Congratulations on this release. > > I'm looking at it right now. > > :D > > On Tue, Jan 31, 2012

Re: GIS Distance from Point to Geometry Collection

2012-01-31 Thread Jeff Heard
anks again! > > > On Tue, Jan 31, 2012 at 9:04 PM, Jeff Heard > wrote: > >> Got it. So what you want to do is a list comprehension over the geometry >> object, which *should* give you individual geometries is what it sounds >> like. Then you can calculate d

Re: GIS Distance from Point to Geometry Collection

2012-01-31 Thread Jeff Heard
t;> smallest distance from one point to any of the points, lines, or polygons >> inside of a queryset. The data I am receiving from the queryset is a >> geometrycollection already... That is how it is being stored in the >> database. >> >> On Tue, Jan 31, 2012 at 8:36

Re: GIS Distance from Point to Geometry Collection

2012-01-31 Thread Jeff Heard
You should be able to create a geometrycollection object from a queryset (you may have to use a list comprehension for this), then calculate the centroid and take the distance from that. Taking the distance from the edge should only be a little more Complicated. Check the django GEOS API docs F

ANN: OGC Web Feature Service for GeoDjango

2012-01-31 Thread Jeff Heard
https://github.com/JeffHeard/ga_ows http://geoanalytics.renci.org/uncategorized/ogc-wfs-for-django-released-on-github/ It's not feature complete yet by any means, but it is quite usable. There is also an implementation of WMS included, but it is currently undocumented as I clean up that code and

Re: Tutorial for dev version not working (Polls app): admin

2012-01-29 Thread Jeff Heard
syncdb will not remake tables that are already made. For that you will have to pipe the output of: $ python manage.py resetsql through your database backend. Then try restarting the server and looking at your admin. On Sat, Jan 28, 2012 at 10:15 PM, Alec Taylor wrote: > Going through the tut

Re: Problem in Geodjango

2012-01-27 Thread Jeff Heard
Check that you are actually using the django.contrib.gis.db.backends.postgis (or other) database backend in your settings.py. It sounds like the SQL to create geometry columns is never getting called. On Thu, Jan 12, 2012 at 4:38 AM, Vicky .. wrote: > Hi Everyone .. > > I am following the steps g

Re: GeoDjango - Error while importing data

2012-01-27 Thread Jeff Heard
you are using Postgres 9.1 There is a bug in the adapter for 9.1. It is addressed and fixed with this patch: https://code.djangoproject.com/ticket/16778 On Mon, Jan 16, 2012 at 2:52 AM, Serge RABEVOHITRA < serge.rabevohi...@gmail.com> wrote: > Hi, > > I've just begun to learn GeoDjango. So I f

Re: A problem with a solution, but is it the right one?

2012-01-20 Thread Jeff Heard
a. > > Francesc > > On Jan 18, 8:42 pm, Jeff Heard wrote: > > My basic problem is this: I have multiple kinds of requests that come in, > > and some of them share parameters and valid values and default values. I > > cannot expect my users to pass all form values on

A problem with a solution, but is it the right one?

2012-01-18 Thread Jeff Heard
My basic problem is this: I have multiple kinds of requests that come in, and some of them share parameters and valid values and default values. I cannot expect my users to pass all form values on the URL line, but unpassed parameters must be set to appropriate defaults, not merely None. These sha

Re: Missing something obvious? Question about forms

2012-01-18 Thread Jeff Heard
is not how you would present this to > the user - although maybe you are just using the form for processing > and not to generate a presentation layer. > > Cheers > > Tom > > On Wed, Jan 18, 2012 at 4:01 PM, Jeff Heard > wrote: > > Sadly these str

Re: Missing something obvious? Question about forms

2012-01-18 Thread Jeff Heard
Sadly these strings are arbitrary, yes... I suppose I could subclass MultipleChoiceField and kill the validator. On Wed, Jan 18, 2012 at 10:54 AM, Tom Evans wrote: > On Wed, Jan 18, 2012 at 3:51 PM, Andre Terra wrote: > > https://docs.djangoproject.com/en/dev/ref/forms/fields/#choicefield > > >

Case insensitive query dictionaries

2012-01-18 Thread Jeff Heard
I have a standard that requires that HTTP parameter names be case-insensitive, and while I thought for awhile I could ignore that requirement, I've found that clients use all kinds of case structures on their parameters, so I need case insensitivity. Is there a standard way to ignore the case of p

Missing something obvious? Question about forms

2012-01-18 Thread Jeff Heard
I have a largish API I have to implement from a standard, and it requires very complex HTTP processing. I'd like to use django.forms.Form for that, but I can't figure out how to use a form to store a list of parameters. So while my homemade code might be: foo = int(request.get('foo', '1')) bar =

Re: pseudo one-to-one

2012-01-16 Thread Jeff Heard
You might modify the manager to store historical entries in a different table with the same structure. On Jan 16, 2012, at 2:18 AM, Mike Dewhirst wrote: > On 16/01/2012 5:19pm, Bill Beal wrote: >> Why not have a child model that differs from the one-to-one child model >> in that the parent k

Re: Does anyone know any blogs that write about how to quickly install and deploy a django application on Amazon EC2?

2012-01-12 Thread Jeff Heard
http://kencochrane.net/blog/2011/06/django-gunicorn-nginx-supervisord-fabric-centos55/ I would go there. It's not Amazon EC2 specific, but Amazon's distribution by default is a Centos-based one, so everything should be in the same place. Plus, he very helpfully gives you code you can use to get

Re: collectstatic missing on Linux

2012-01-09 Thread Jeff Heard
Make sure the staticfiles app is in your INSTALLED_APPS setting. That'd be my first guess. If it is, do a manage.py console and try importing it to make sure that the django environment can see it. -- Jeff On Tue, Jan 10, 2012 at 1:22 AM, Mike Dewhirst wrote: > The manage.py collectstatic subc

ModelForms and ProcessFormViews w models containing BooleanFields

2011-12-20 Thread Jeff Heard
I feel like this should be obvious but I can't figure it out. When creating a ProcessFormView or a ModelForm on a model with a BooleanField somewhere in, I get the classic problem of "This field is required" in the actual rendered page. Is there some way to turn off this behaviour and make the fi

Re: Error in syncdb

2011-12-03 Thread Jeff Heard
Never mind. My error was elsewhere. A little putzing around led me to realize that you can't put db_index=True into a geometry field of any sort in PostGIS backend. On Sat, Dec 3, 2011 at 11:25 AM, Jeff Heard wrote: > I have a custom field type that I defined, and now I can'

Error in syncdb

2011-12-03 Thread Jeff Heard
I have a custom field type that I defined, and now I can't do a syncdb. The relevant bits of the type are class PyMongoField(models.CharField): __metaclass__ = models.SubFieldBase ... def db_type(self, connection): return 'varchar(64)' ... But I just get this when I do reset o

Re: Perhaps more of a general Python question, but..

2011-11-23 Thread Jeff Heard
overwritten all of django, because when I type python manage.py shell I get "no module named core.management" -- Jeff On Wed, Nov 23, 2011 at 2:15 PM, DrBloodmoney wrote: > On Wed, Nov 23, 2011 at 2:01 PM, Jeff Heard > wrote: > > I have several django apps. all of which

Perhaps more of a general Python question, but..

2011-11-23 Thread Jeff Heard
I have several django apps. all of which are in separate packages and can be installed seperately. I would like them all to be sub-packages of a master package named "ga" So: ga.datacube ga.pyramid ga.sensorcollection and so on. The problem is that when I install them the packages never seem t

Re: Editable datagrid

2011-11-21 Thread Jeff Heard
You have multiple licensing options. One of those licenses is the GPL. How that translates to "open source" is the source of an eternal flamewar that we'll quietly skip. If your organization permits GPL then you're fine. -- Jeff On Mon, Nov 21, 2011 at 11:43 PM, Vikas Rawal < vikasli...@agraria

Re: Editable datagrid

2011-11-21 Thread Jeff Heard
I would look at Sencha. They seem to have a nice clean grid control. It uses a RESTful interface for importing / exporting data from local data models via an AJAX proxy. You use JSON to ship data back and forth. I'd think you could use something like django-piston to expose your models to the

Re: Question on cleaning ModelForms

2011-10-18 Thread Jeff Heard
But I want to be able to invalidate my form if geocoding fails... Can I still do that in the save method? On Oct 18, 2011, at 4:52 AM, Daniel Roseman wrote: > On Monday, 17 October 2011 20:30:35 UTC+1, Jefferson Heard wrote: > class FarmersMarket(ModelForm): >class Meta: > model =

Question on cleaning ModelForms

2011-10-17 Thread Jeff Heard
class FarmersMarket(ModelForm): class Meta: model = models.FarmersMarket exclude = ('location',) def clean(self): place, (lat, lng) = _g.geocode(self.cleaned_data['address']) self.cleaned_data['location'] = Point(lng,lat) return self.cleaned_data Here's m

Re: Is there a way to provide a delete-hook on a custom field?

2011-09-13 Thread Jeff Heard
Thanks. That works! -- Jeff On Tue, Sep 13, 2011 at 11:13 AM, Shawn Milochik wrote: > You can use the post_delete signal in Django's signals. Then, assuming your > MongoDB collection name is derived from your model in a consistent manner > then you're all set. > > -- > You received this message

Is there a way to provide a delete-hook on a custom field?

2011-09-13 Thread Jeff Heard
I have a custom field class that very nicely references a document in MongoDB, but I would like to have the document deleted if the record is deleted. That is, I have a MongoDBField that stores an object ID in a structured database using the regular Django ORM. The field back-references to the re