From 94d7143cd2beb4eb1fe55f06ff709ef409acf986 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 1 Feb 2016 11:20:57 -0700 Subject: [PATCH] Collections too soon --- ccdb/collections_ccdb/models.py | 47 +++++++++++++++++---------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/ccdb/collections_ccdb/models.py b/ccdb/collections_ccdb/models.py index d88b804..024558e 100644 --- a/ccdb/collections_ccdb/models.py +++ b/ccdb/collections_ccdb/models.py @@ -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')