예제 #1
0
 def save(self, *args, **kwargs):
     if self.wind_speed == 0.00 and self.wind_dir == 1 and self.estimated_temperature == -49:
         # only fetch weather if it appears to be defaults
         weather = get_weather(self)
         self.estimated_temperature = weather['temperature']
         self.cloud_level = weather['description']
         self.wind_speed = weather['wind_speed']
         self.wind_dir = weather['wind_dir']
     super(ChallengeEvent, self).save(*args, **kwargs)
예제 #2
0
 def save(self, *args, **kwargs):
     if self.wind_speed == 0.00 and self.wind_dir == 1 and self.estimated_temperature == -49:
         # only fetch weather if it appears to be defaults
         weather = get_weather(self, 39.619718, -77.023989)
         # weather = get_weather(self, self.location.latitude, self.location.longitude)
         self.estimated_temperature = weather['temperature']
         self.cloud_level = weather['description']
         self.wind_speed = weather['wind_speed']
         self.wind_dir = weather['wind_dir']
     super(Harvests, self).save(*args, **kwargs)
예제 #3
0
 def save(self, *args, **kwargs):
     if self.wind_speed == 0.00 and self.wind_dir == -1 and self.estimated_temperature == -49:
         # only fetch weather if it appears to be defaults
         # weather = get_weather(self)
         weather = get_weather(self, self.location.latitude, self.location.longitude)
         self.estimated_temperature = weather['temperature']
         self.cloud_level = weather['description']
         self.wind_speed = weather['wind_speed']
         self.wind_dir = weather['wind_dir']
         self.wind_dir_word = weather['wind_dir_word']
         self.weather_icon_url = weather['weather_icon_url']
     super(RemovalsByLocation, self).save(*args, **kwargs)
예제 #4
0
def page_all_groundhog_removals_by_shooter_pk(request, shooter_pk=1):
    step_hit_count_by_page(request.path)
    all_news = all_groundhog_removals_by_shooter(shooter_pk)
    weather = get_weather(request)

    context = {
        # "restart": get_restart_notice,
        "copy_year": datetime.now().year,
        "weather": weather,
        "all_news": all_news,
        'release': get_version_json(),
        "title": "Groundhog Logbook",
        "blurb": get_page_blurb_override('groundhog_logbook/by_shooter/'),
    }
    return render(request, "groundhog_logbook/all_groundhog_kills.html",
                  context)
예제 #5
0
def page_all_harvests(request):
    step_hit_count_by_page(request.path)
    weather = get_weather(request)
    perm_check = request.user.has_perm(
        'deer_harvest_logbook.view_deermanagementpermit')
    unrestricted_user = perm_check

    context = {
        "copy_year": datetime.now().year,
        "all_news": all_harvests(request),
        "weather": weather,
        'release': get_version_json(),
        "title": "Deer Harvest Logbook",
        "unrestricted_user": unrestricted_user,
        "blurb": get_page_blurb_override('deer_harvest_logbook/'),
    }
    return render(request, "deer_harvest_logbook/all_harvests.html", context)
예제 #6
0
def page_all_groundhog_removals(request):
    step_hit_count_by_page(request.path)
    all_news = all_groundhog_removals(request)
    weather = get_weather(request)
    context = {
        "weather": weather,
        # "restart": get_restart_notice,
        "copy_year": datetime.now().year,
        "all_news": all_news,
        'release': get_version_json(),
        "title": "Groundhog Logbook",
        # "blurb": "this is a blurb that goes on the page for testing. blah blah blah.",
        "blurb": get_page_blurb_override('groundhog_logbook/by_shooter/'),
    }

    # print(weather)
    return render(request, "groundhog_logbook/all_groundhog_kills.html",
                  context)