Created
January 20, 2011 02:28
-
-
Save dylanvee/787301 to your computer and use it in GitHub Desktop.
Django model definitions for Collector, Observation, and USDA Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
# Collectors run for each county both when a new user requests data and periodically for existing users. | |
class Collector(models.Model): | |
name = models.CharField(max_length=100) | |
priority = models.IntField() | |
# Collectors create Observations | |
class Observation(models.Model): | |
scientific_name = models.CharField(max_length=100) | |
common_name = models.CharField(max_length=100) | |
observation_time = models.DateTimeField() | |
latitude = models.FloatField() | |
longitude = models.FloatField() | |
thumbnail = models.ImageField() | |
image = models.URLField() | |
credit = models.CharField(max_length=100) | |
source = models.ForeignKey(Collector) | |
# Cache USDA queries by parameters and county | |
class USDAQuery(models.Model): | |
name = models.CharField(max_length=100) | |
last_run = models.DateTimeField() | |
county_name = models.CharField(max_length=100) | |
state_name = models.CharField(max_length=100) | |
request_data = modelsTextField() | |
response_data = modelsTextField() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment