def update_greeley_headquarters_location(apps, schema_editor):
     FD = apps.get_model("firestation", "firedepartment")
     IP = apps.get_model("usgs", "IncorporatedPlace")
     # Have to patch this in since RelatedObjectsDescriptor won't be attached
     monkey_patch(FD, 'government_unit')
     greeley = IP.objects.filter(place_name='Greeley', state_name='Colorado').first()
     fd = FD.objects.filter(id=97668).first()
     if fd:
         fd.headquarters_address.geom = Point(-104.694001, 40.426638)
         fd.headquarters_address.save()
         fd.geom = greeley.geom
         fd.government_unit.connect(greeley)
         fd.population = greeley.population
         fd.save()
 def update_greeley_headquarters_location(apps, schema_editor):
     FD = apps.get_model("firestation", "firedepartment")
     IP = apps.get_model("usgs", "IncorporatedPlace")
     # Have to patch this in since RelatedObjectsDescriptor won't be attached
     monkey_patch(FD, 'government_unit')
     greeley = IP.objects.filter(place_name='Greeley',
                                 state_name='Colorado').first()
     fd = FD.objects.filter(id=97668).first()
     if fd:
         fd.headquarters_address.geom = Point(-104.694001, 40.426638)
         fd.headquarters_address.save()
         fd.geom = greeley.geom
         fd.government_unit.connect(greeley)
         fd.population = greeley.population
         fd.save()
Example #3
0
    class Meta:
        model = Photo
        fields = ('title', 'photo',)

########NEW FILE########
__FILENAME__ = models
from providers import *

from basic.blog.models import Post
from basic.media.models import Photo
from completion.listeners import start_listening
from genericm2m.utils import monkey_patch


# monkey patch the Post model with a related objects descriptor
monkey_patch(Post)
monkey_patch(Photo)

# configure our signal handlers so we can update the autocomplete index on
# model save & delete
start_listening()

########NEW FILE########
__FILENAME__ = providers
from completion import site, DjangoModelProvider

from basic.blog.models import Post
from basic.media.models import Photo
from basic.people.models import Person
from basic.places.models import City, Place
Example #4
0
            'title',
            'photo',
        )


########NEW FILE########
__FILENAME__ = models
from providers import *

from basic.blog.models import Post
from basic.media.models import Photo
from completion.listeners import start_listening
from genericm2m.utils import monkey_patch

# monkey patch the Post model with a related objects descriptor
monkey_patch(Post)
monkey_patch(Photo)

# configure our signal handlers so we can update the autocomplete index on
# model save & delete
start_listening()

########NEW FILE########
__FILENAME__ = providers
from completion import site, DjangoModelProvider

from basic.blog.models import Post
from basic.media.models import Photo
from basic.people.models import Person
from basic.places.models import City, Place