gis: Modifications to Django management commands to support creation of spatial tables.
|Reported by:||jbronn||Owned by:||nobody|
|Severity:||Keywords:||gis syncdb sql|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This patch contains the following changes that enable the Django management commands to construct spatial SQL for PostGIS:
- The addition of the _post_create_sql hook. If a custom field has this function it will be called and its output will precede any other SQL generated by sql.custom_sql_for_model. This works well, but I'm of course open to changes in the function name and/or the possibility of a post_table_create signal or something (doing after post_syncdb will not work).
- Although not required for GeoDjango having custom_sql_for_model take the style object as a parameter allows for colorizing the generated spatial SQL -- the sqlcustom and syncdb commands are modified to pass in their style object to custom_sql_for_model.
Change History (4)
Changed 7 years ago by jbronn
comment:1 Changed 7 years ago by mtredinnick
- Resolution set to fixed
- Status changed from new to closed
comment:2 Changed 7 years ago by mtredinnick
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset