Hope you got to the bottom of this, and yes I thought your original 
question was pretty direct.

If you haven't worked it out already and are still trying to get this 
working (or if anyone else stumbles across this), then essentially yes you 
would pass in geography=True, just as you would specify max_length=30 or 
any other field property.  The documentation suggests this only works with 
SRID 4326, so you need srid=4326 on your field as well.

On Saturday, November 3, 2012 6:24:32 PM UTC, JJ Zolper wrote:
>
> Thanks for the reply.
>
> I actually already have PostgreSQL.
>
> So my question was pretty direct, or so I thought.
>
> I'll try and spell this out again. So if I want to create a column in my 
> database with type "geography" is this the syntax:
>
> mpoly = models.MultiPolygonField(geography=true)
>
> I cannot find an single example where we specify that we want the 
> geography type to be used instead of using geometries.
>
> All I need to know is if that is right? Is it a capitalized "true" so 
> "TRUE" ?
>
> Thanks so much,
>
> JJ
>
> On Friday, November 2, 2012 10:15:40 PM UTC-4, Dump wrote:
>>
>> First of all, you have to create a geo database. Postgis (a PostgreSQL 
>> extension) is the best choice. 
>>
>> After that, you have to define some geography fields and import your 
>> data, shape files (shp), etc. 
>>
>> GeoDjango Tutorial provides all the steps to get it done. 
>>
>> https://docs.djangoproject.com/en/dev/ref/contrib/gis/tutorial/
>>
>> If you are not familiar with geo concepts, I recommend to take a look at 
>> http://geodjango.org/presentations/
>>
>> Hope that helps you
>>
>>
>>
>>
>> On Fri, Nov 2, 2012 at 11:30 PM, JJ Zolper <codin...@gmail.com> wrote:
>>
>>> Wait so does anyone know how to do this?
>>>
>>> I posted this a long time ago.
>>>
>>> How do I define a geography field? I need a geography column so I can 
>>> perform geographic queries on it and the documentation doesn't give me 
>>> a definitive way on how to do it.
>>>
>>> Would it be like:
>>>
>>> city = models.CharField(max_length=50, GeometryField.geography = true)
>>>
>>> ???
>>>
>>>
>>> On Saturday, October 20, 2012 1:22:32 PM UTC-4, JJ Zolper wrote:
>>>>
>>>> Hello everyone,
>>>>
>>>> So I've decided for my GeoDjango application I want WGS84 along with a 
>>>> geography database column, rather than geometry.
>>>>
>>>> I was reading here:
>>>>
>>>> https://docs.djangoproject.com/en/1.4/ref/contrib/gis/
>>>> model-api/#geography
>>>>
>>>> GeometryField.geography<https://docs.djangoproject.com/en/1.4/ref/contrib/gis/model-api/#django.contrib.gis.db.models.GeometryField.geography>
>>>>  
>>>>
>>>> If set to True, this option will create a database column of type 
>>>> geography, rather than geometry. Please refer to the geography 
>>>> type<https://docs.djangoproject.com/en/1.4/ref/contrib/gis/model-api/#geography-type>
>>>>  section 
>>>> below for more details.
>>>>
>>>>
>>>> that to set up a new column as geography I had to 
>>>> set GeometryField.geography = True.
>>>>
>>>> I am unsure of the syntax of how to do this? There was no example 
>>>> given. Or where to properly place this line?
>>>>
>>>> Here is the model.py file I am working on. If you could tell me where 
>>>> to fit this in that would be great?
>>>>
>>>>
>>>> from django.contrib.gis.db import models
>>>>
>>>> class Artist(models.Model):
>>>>     name = models.CharField(max_length=30)
>>>>     genre = models.CharField(max_length=30)
>>>>     city = models.CharField(max_length=60)
>>>>     state = models.CharField(max_length=30)
>>>>     country = models.CharField(max_length=50)
>>>>     website = models.URLField()
>>>>     objects = models.GeoManager()
>>>>
>>>>     def __unicode__(self):
>>>>        return self.name
>>>>
>>>>
>>>>
>>>> Thanks so much,
>>>>
>>>> JJ
>>>>
>>>  -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msg/django-users/-/tWBJBDuXZzYJ.
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> django-users...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> -- 
>> Christiano Anderson | http://christiano.me/
>> http://twitter.com/dump
>>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a4d6ef0c-b33d-4fc9-8e25-47f5b7dad004%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to