Mercurial > public > sg101
annotate bandmap/management/commands/update_bands.py @ 843:09ed84a7394c
For issue #76, store pre-rendered HTML for each band map entry.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Mon, 13 Oct 2014 16:48:43 -0500 |
parents | |
children |
rev | line source |
---|---|
bgneal@843 | 1 """ |
bgneal@843 | 2 This command calls save() on all bandmap entries. |
bgneal@843 | 3 |
bgneal@843 | 4 This causes the html field to be rebuilt. This is the text displayed inside the |
bgneal@843 | 5 "balloon" on the map when a band's marker is clicked. |
bgneal@843 | 6 |
bgneal@843 | 7 """ |
bgneal@843 | 8 from django.core.management.base import NoArgsCommand |
bgneal@843 | 9 |
bgneal@843 | 10 from bandmap.models import BandEntry |
bgneal@843 | 11 |
bgneal@843 | 12 |
bgneal@843 | 13 class Command(NoArgsCommand): |
bgneal@843 | 14 help = "This command rebuilds the html field on all bandmap entries." |
bgneal@843 | 15 |
bgneal@843 | 16 def handle_noargs(self, **kwargs): |
bgneal@843 | 17 |
bgneal@843 | 18 for band in BandEntry.objects.all().iterator(): |
bgneal@843 | 19 band.save() |