Collections too soon

This commit is contained in:
Matthew Ryan Dillon 2016-02-01 11:20:57 -07:00
parent 528dfcc57e
commit 94d7143cd2

View file

@ -3,26 +3,27 @@ from django.db import models
from autoslug import AutoSlugField
class Collection(models.Model):
projectid = models.ForeignKey('TblLuProjects', db_column='ProjectID') # Field name made lowercase.
collectionid = models.AutoField(db_column='CollectionID', primary_key=True) # Field name made lowercase.
study_locationid = models.ForeignKey('TblLuStudyLocations', db_column='Study_LocationID') # Field name made lowercase.
collection_typeid = models.ForeignKey('TblLuCollectionTypes', db_column='Collection_TypeID') # Field name made lowercase.
collection_methodid = models.ForeignKey('TblLuCollectionMethods', db_column='Collection_MethodID') # Field name made lowercase.
number_of_traps = models.IntegerField(db_column='Number_Of_Traps', blank=True, null=True) # Field name made lowercase.
collection_start_date = models.DateField(db_column='Collection_Start_Date', blank=True, null=True) # Field name made lowercase.
collection_start_time = models.TimeField(db_column='Collection_Start_Time', blank=True, null=True) # Field name made lowercase.
collection_end_date = models.DateField(db_column='Collection_End_Date', blank=True, null=True) # Field name made lowercase.
collection_end_time = models.TimeField(db_column='Collection_End_Time', blank=True, null=True) # Field name made lowercase.
storage_locationid = models.ForeignKey('TblLuStorageLocations', db_column='Storage_LocationID', blank=True, null=True) # Field name made lowercase.
specimen_state = models.CharField(db_column='Specimen_State', max_length=50, blank=True, null=True) # Field name made lowercase.
process_typeid = models.ForeignKey('TblLuProcessTypes', db_column='Process_TypeID', blank=True, null=True) # Field name made lowercase.
reagentid = models.ForeignKey('TblLuReagents', db_column='ReagentID', blank=True, null=True) # Field name made lowercase.
adfg_permit = models.CharField(db_column='ADFG_Permit', max_length=25, blank=True, null=True) # Field name made lowercase.
link_to_datasheets = models.CharField(db_column='Link_To_Datasheets', max_length=255, blank=True, null=True) # Field name made lowercase.
flawid = models.ForeignKey('TblLuRecordFlaws', db_column='FlawID', blank=True, null=True) # Field name made lowercase.
class Meta:
managed = False
db_table = 'tbl_Collections'
unique_together = (('ProjectID', 'Study_LocationID', 'Collection_TypeID', 'Collection_Start_Date', 'Collection_End_Date', 'Collection_MethodID'),)
# class Collection(models.Model):
# project = models.ForeignKey('projects.Project')
# study_location = models.ForeignKey('locations.StudyLocation')
# collection_type = models.ForeignKey(CollectionType)
# collection_method = models.ForeignKey(CollectionMethod)
# number_of_traps = models.IntegerField(blank=True, null=True)
# collection_start_date = models.DateField(blank=True, null=True)
# collection_start_time = models.TimeField(blank=True, null=True)
# collection_end_date = models.DateField(blank=True, null=True)
# collection_end_time = models.TimeField(blank=True, null=True)
# storage_location = models.ForeignKey('locations.StorageLocation', blank=True, null=True)
# specimen_state = models.CharField(max_length=50, blank=True)
# process_type = models.ForeignKey('processing.ProcessType', blank=True, null=True)
# reagent = models.ForeignKey('processing.Reagent', blank=True, null=True)
# # adfg_permit = models.CharField(db_column='ADFG_Permit', max_length=25, blank=True, null=True) # Field name made lowercase.
# # link_to_datasheets = models.CharField(db_column='Link_To_Datasheets', max_length=255, blank=True, null=True) # Field name made lowercase.
# flaw = models.ForeignKey(Flaw, blank=True, null=True)
#
# def __str__(self):
# return "{project} {study_location} {collection_type} {collection_method}".format(**self)
#
# class Meta:
# unique_together = ('project', 'study_location', 'collection_type',
# 'collection_start_date', 'collection_end_date', 'collection_method')