Changeset 6243
- Timestamp:
- 09/14/07 17:56:43 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis/django/contrib/gis/db/models/proxy.py
r5806 r6243 20 20 geom_value = obj.__dict__[self._field.attname] 21 21 22 if (geom_value is None) or (isinstance(geom_value, GEOSGeometry)):22 if isinstance(geom_value, GEOSGeometry): 23 23 # If the value of the field is None, or is already a GEOS Geometry 24 24 # no more work is needed. 25 geom = geom_value 25 geom = geom_value 26 elif (geom_value is None) or (geom_value==''): 27 geom = None 26 28 else: 27 29 # Otherwise, a GEOSGeometry object is built using the field's contents, django/branches/gis/django/contrib/gis/tests/geoapp/tests.py
r5881 r6243 257 257 self.assertEqual('Lawrence', City.objects.get(point__relate=(ks.poly, 'T********')).name) 258 258 259 def test16_createnull(self): 260 "Testing creating a model instance and the geometry being None" 261 c = City() 262 self.assertEqual(c.point, None) 263 259 264 def suite(): 260 265 s = unittest.TestSuite()
