Login

Tag "map"

Snippet List

Queryset Foreach

Call a function for each element in a queryset (actually, any list). Features: * stable memory usage (thanks to Django paginators) * progress indicators * wraps batches in transactions * can take managers or even models (e.g., `Assertion.objects`) * warns about `DEBUG`. * handles failures of single items without dying in general. * stable even if items are added or removed during processing (gets a list of ids at the start) Returns a `Status` object, with the following interesting attributes * `total`: number of items in the queryset * `num_successful`: count of successful items * `failed_ids`: list of ids of items that failed

  • queryset
  • progress
  • callback
  • map
  • foreach
  • iterator
Read More

google.js template for GoogleAdmin

JavaScript template for [GoogleAdmin](http://www.djangosnippets.org/snippets/1144/). Also requires the [google.html](http://www.djangosnippets.org/snippets/1145/) template. Install in `gis/admin` somewhere in your template path.

  • gis
  • google
  • map
  • gmaps
  • layer
  • openlayers
Read More

google.html template for GoogleAdmin

HTML template for [GoogleAdmin](http://www.djangosnippets.org/snippets/1144/). Also requires the [google.js](http://www.djangosnippets.org/snippets/1146/) template. Install in `gis/admin` somewhere in your template path.

  • gis
  • google
  • map
  • gmaps
  • layer
  • openlayers
Read More

GoogleAdmin: GMaps base layer in Geographic Admin (GeoDjango)

This GeoDjango subclass substitutes in the Google Maps base layer instead of the default one provided by Open Street Map. Requires the [google.html](http://www.djangosnippets.org/snippets/1145/) and [google.js](http://www.djangosnippets.org/snippets/1146/) templates (must be placed in `gis/admin` somewhere in your template path). Requires a Google Maps API key -- please abide by Google's [terms of service](http://code.google.com/apis/maps/terms.html).

  • gis
  • google
  • map
  • gmaps
  • layer
  • openlayers
Read More

Google Map Field and Widget

There is a sample in the code. You can use this snippet to allow your forms to easily edit object locations. Take care about what you should add to your templates in order to make it work.

  • newforms
  • field
  • widget
  • gmap
  • map
  • google-map
Read More

6 snippets posted so far.