Python django.contrib.gis.db.models.CharField() Examples
The following are 2
code examples of django.contrib.gis.db.models.CharField().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
django.contrib.gis.db.models
, or try the search function
.
Example #1
Source File: feature_class_creator.py From urbanfootprint with GNU General Public License v3.0 | 6 votes |
def resolve_field(meta): type = meta['type'] rest = merge(filter_dict( # Don't allow default='SEQUENCE' lambda key, value: not (key=='default' and value=='SEQUENCE'), # Ignore these keys remove_keys(meta, ['type', 'auto_populate', 'visible', 'geometry_type', 'nullable']) ), dict(null=True)) if type=='string': return models.CharField(**rest) elif type=='integer': return models.IntegerField(**rest) elif type=='float': return models.FloatField(**rest) elif type=='biginteger': return models.BigIntegerField(**rest) elif type=='geometry': return models.GeometryField(geography=False, **rest) elif type=='date': return models.DateField(**rest) elif type=='datetime': return models.DateTimeField(**rest)
Example #2
Source File: feature_class_creator.py From urbanfootprint with GNU General Public License v3.0 | 5 votes |
def feature_class_configuration_from_geojson_introspection(self, data): """ Creates a dynamic Feature class configuration by introspecting the db_entity's Feature table. :return: The Feature class configuration """ properties = unique(flat_map(lambda feature: feature.properties.keys(), data.features)) fields = map(lambda property: models.CharField(property), properties) return self.generate_configuration(fields)