33# Create your models here.
44
55class Location (models .Model ):
6+ """
7+ TODO: Description of class
8+ """
69 location_name = models .CharField (max_length = 45 , blank = False )
710 location_code = models .CharField (max_length = 45 , blank = False )
811 location_type = models .CharField (max_length = 45 )
912
1013
1114class Family (models .Model ):
15+ """
16+ TODO: Description of class
17+ """
1218 family = models .CharField (max_length = 45 , blank = False )
1319
1420
1521class ScientificName (models .Model ):
22+ """
23+ TODO: Description of class
24+ """
1625 scientific_name = models .CharField (max_length = 45 , blank = False )
1726
1827
1928class Variety (models .Model ):
29+ """
30+ TODO: Description of class
31+ """
2032 variety = models .CharField (max_length = 45 , blank = False )
2133 seed_color = models .CharField (max_length = 75 )
22- parts_to_harvest = models .TextField ()
34+ parts_to_harvest = models .TextField ()
2335 unique_characteristics = models .TextField ()
2436 planting_intructions = models .TextField ()
2537
2638 scientific_name = models .ForeignKey (ScientificName )
2739
2840
2941class Germination (models .Model ):
42+ """
43+ TODO: Description of class
44+ """
3045 germ_rate = models .DecimalField (decimal_places = 2 , max_digits = 2 , blank = False )
3146 germ_date = models .DateField (blank = False )
3247 germ_method = models .TextField ()
3348
3449
3550class CommonName (models .Model ):
51+ """
52+ TODO: Description of class
53+ """
3654 common_name = models .CharField (max_length = 45 )
3755 langs = (("English" , "English" ), ("Thai" , "Thai" ))
3856 language = models .CharField (max_length = 45 , choices = langs , default = "English" )
3957 scientific_name = models .ForeignKey (ScientificName )
4058
4159
4260class SupplierType (models .Model ):
61+ """
62+ TODO: Description of class
63+ """
4364 supplier_type = models .CharField (max_length = 45 )
4465
4566
4667class Supplier (models .Model ):
68+ """
69+ TODO: Description of class
70+ """
4771 supplier_name = models .CharField (max_length = 45 , blank = False )
4872 contact_first_name = models .CharField (max_length = 45 )
4973 contact_last_name = models .CharField (max_length = 45 )
@@ -64,17 +88,22 @@ class Supplier(models.Model):
6488
6589
6690class Seed (models .Model ):
91+ """
92+ TODO: Description of class
93+ """
6794 accession_num = models .CharField (max_length = 8 , blank = False )
6895 lot_num = models .CharField (max_length = 5 , blank = False )
6996 aquisition_date = models .DateField (blank = False )
70- cost = models .DecimalField (decimal_places = 2 , max_digits = 6 , blank = False )
97+ cost = models .DecimalField (decimal_places = 2 , max_digits = 6 , blank = False )
7198
7299 aquisition_location = models .ForeignKey (Location )
73100 family = models .ForeignKey (Family )
74101 variety = models .ForeignKey (Variety )
75102 scientific_name = models .ForeignKey (ScientificName )
76103 germination = models .ForeignKey (Germination )
77104
78- # I think this one is supposed to be here... ?
79- supplier = models .ForeignKey (Supplier )
105+ # I think this one is supposed to be here... ?
106+ supplier = models .ForeignKey (Supplier )
80107
108+ def get_absolute_url (self ):
109+ return reverse ('seeds-view' , kwargs = {'pk' : self .id })
0 commit comments