May 2016
Beginner to intermediate
446 pages
10h 7m
English
The built-in admin application is enabled by default in new Django projects. Before we can use it, however, we need to register the various database models we want it to support. To do this, edit the admin.py module within the shapeEditor/shared directory, and enter the following into this file:
from django.contrib.gis import admin from shapeEditor.shared.models import * admin.site.register(Shapefile, admin.ModelAdmin) admin.site.register(Feature, admin.GeoModelAdmin) admin.site.register(Attribute, admin.ModelAdmin) admin.site.register(AttributeValue, admin.ModelAdmin)
The ModelAdmin class tells Django how to display the model within the admin interface. Notice that we use the GeoModelAdmin class for the Feature class. ...
Read now
Unlock full access