Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
syncdb works now that models.py is cleaned up
- Loading branch information
Showing
2 changed files
with
46 additions
and
35 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,20 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
class Seed(models.Model): | ||
This comment has been minimized.
Sorry, something went wrong. |
||
accession_num = models.CharField(max_length=8, blank=False) | ||
lot_num = models.CharField(max_length=5, blank=False) | ||
aquisition_date = models.DateField(blank=False) | ||
cost = models.DecimalField(max_length=4, blank=False) | ||
|
||
aquisition_location = models.ForeignKey(Location) | ||
family = models.ForeignKey(Family) | ||
variety = models.ForeignKey(Variety) | ||
scientific_name = models.ForeignKey(ScientificName) | ||
germination = models.ForeignKey(Germination) | ||
class Location(models.Model): | ||
location_name = models.CharField(max_length=45, blank=False) | ||
location_code = models.CharField(max_length=45, blank=False) | ||
location_type = models.CharField(max_length=45) | ||
|
||
|
||
class Family(models.Model): | ||
family = models.CharField(max_length=45, blank=False) | ||
|
||
# I think this one is supposed to be here... ? | ||
supplier = models.ForeignKey(Supplier) | ||
|
||
class ScientificName(models.Model): | ||
scientific_name = models.CharField(max_length=45, blank=False) | ||
|
||
class CommonName(models.Model): | ||
common_name = models.CharField(max_length=45) | ||
langs = (("English", "English"), ("Thai", "Thai")) | ||
language = models.CharField(max_length=45, choices=langs, default="English") | ||
scientific_name = models.ForeignKey(ScientificName) | ||
|
||
class Variety(models.Model): | ||
variety = models.CharField(max_length=45, blank=False) | ||
|
@@ -34,37 +25,56 @@ class Variety(models.Model): | |
|
||
scientific_name = models.ForeignKey(ScientificName) | ||
|
||
class Family(models.Model): | ||
family = models.CharField(max_length=45, blank=False) | ||
|
||
class Location(models.Model): | ||
location_name = models.CharField(max_length=45, blank=False) | ||
location_code = models.CharField(max_length=45, blank=False) | ||
location_type = models.CharField(max_length=45) | ||
|
||
class Germination(models.Model): | ||
germ_rate = models.DecimalField(max_length=6, blank=False) | ||
germ_rate = models.DecimalField(decimal_places=2, max_digits=2, blank=False) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
germ_date = models.DateField(blank=False) | ||
germ_method = models.TextField() | ||
|
||
|
||
class CommonName(models.Model): | ||
common_name = models.CharField(max_length=45) | ||
langs = (("English", "English"), ("Thai", "Thai")) | ||
language = models.CharField(max_length=45, choices=langs, default="English") | ||
scientific_name = models.ForeignKey(ScientificName) | ||
|
||
|
||
class SupplierType(models.Model): | ||
supplier_type = models.CharField(max_length=45) | ||
|
||
|
||
class Supplier(models.Model): | ||
supplier_name = model.CharField(max_length=45, blank=False) | ||
supplier_name = models.CharField(max_length=45, blank=False) | ||
contact_first_name = models.CharField(max_length=45) | ||
contact_last_name = models.CharField(max_length=45) | ||
contact_phone = models.CharField(max_length=15) | ||
contact_email = models.EmailField() | ||
address_one = models.CharField(max_length=45, blank=False) | ||
address_two = models.CharField(max_length=45) | ||
city = models.CharField(max_length=45, blank=False) | ||
state = models.USStateField() | ||
address_one = models.CharField(max_length=255, blank=False) | ||
This comment has been minimized.
Sorry, something went wrong.
briandant
|
||
address_two = models.CharField(max_length=255) | ||
city = models.CharField(max_length=255, blank=False) | ||
state = models.CharField(max_length=45) | ||
zip_code = models.IntegerField(max_length=10) | ||
country = models.CharField(max_length=45, blank=False) | ||
phone = models.CharField(max_length=15) | ||
email = models.EmailField() | ||
website = models.URLField() | ||
|
||
supplier_type = models.ForeignKey(SupplierTypes) | ||
supplier_type = models.ForeignKey(SupplierType) | ||
primary_seed_bank = models.ForeignKey(Location) | ||
|
||
class SupplierType(models.Model): | ||
supplier_type = models.CharField(max_length=45) | ||
|
||
|
||
class Seed(models.Model): | ||
accession_num = models.CharField(max_length=8, blank=False) | ||
lot_num = models.CharField(max_length=5, blank=False) | ||
aquisition_date = models.DateField(blank=False) | ||
cost = models.DecimalField(decimal_places=2, max_digits=6, blank=False) | ||
|
||
aquisition_location = models.ForeignKey(Location) | ||
This comment has been minimized.
Sorry, something went wrong.
briandant
|
||
family = models.ForeignKey(Family) | ||
variety = models.ForeignKey(Variety) | ||
scientific_name = models.ForeignKey(ScientificName) | ||
germination = models.ForeignKey(Germination) | ||
|
||
# I think this one is supposed to be here... ? | ||
supplier = models.ForeignKey(Supplier) | ||
|
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
Seed had to be moved down b/c some of the related models below were referencing it. (See below)