Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. from django.contrib.gis.db import models as m
  2. from djgeojson.fields import GeometryCollectionField
  3.  
  4. class Doc(m.Model):
  5. name = m.CharField()
  6. type = m.ForeignKey()
  7. geom = GeometryCollectionField()
  8.  
  9. class DocAdmin(admin.ModelAdmin):
  10. form = f.DocGeometryForm
  11. ...
  12.  
  13. class DocGeometryForm(f.ModelForm):
  14. class Meta:
  15. model = m.Doc
  16. widgets = {
  17. 'geom': LeafletWidget(),
  18. }
  19.  
  20. class Media:
  21. css = {
  22. 'all':('ext/leaflet/leaflet.css',)
  23. }
  24. js = [
  25. 'ext/jquery/jquery.js',
  26. 'ext/leaflet/leaflet.js',
  27. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement