Django App to pull a weather forecast from WeatherUnderground

models.py 1.0KB

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import models
  4. class Forecast(models.Model):
  5. title = models.CharField(max_length=100, null=True, blank=True)
  6. text = models.TextField(null=True, blank=True)
  7. temp_high = models.IntegerField(null=True, blank=True)
  8. temp_low = models.IntegerField(null=True, blank=True)
  9. icon = models.CharField(max_length=100, null=True, blank=True)
  10. icon_url = models.URLField(null=True, blank=True)
  11. rain_allday = models.IntegerField(null=True, blank=True)
  12. wind_speed = models.IntegerField(null=True, blank=True)
  13. wind_degrees = models.IntegerField(null=True, blank=True)
  14. wind_direction = models.CharField(max_length=5,null=True, blank=True)
  15. forecast_simple_raw = models.TextField(null=True, blank=True)
  16. forecast_txt_raw = models.TextField(null=True, blank=True)
  17. last_update = models.DateTimeField(auto_created=True, auto_now=True,null=True, blank=True)
  18. def __unicode__(self):
  19. return u'%s: %s' % (self.pk, self.title)