<s> from django . db import models <EOL> from django . contrib . postgres . fields import ArrayField <EOL> from data_collection . models import Firm <EOL> import uuid <EOL> class FirmTrainingSet ( models . Model ) : <EOL> id = models . UUIDField ( primary_key = True , default = uuid . uuid4 , editable = False ) <EOL> firm = models . OneToOneField ( Firm ) <EOL> spider_complete = models . BooleanField ( default = False ) <EOL> page_classifier_trained = models . BooleanField ( default = False ) <EOL> element_classifier_trained = models . BooleanField ( default = False ) <EOL> extraction_complete = models . BooleanField ( default = False ) <EOL> @ classmethod <EOL> def get_for_firm ( cls , firm ) : <EOL> try : <EOL> fts = FirmTrainingSet . objects . get ( firm = firm ) <EOL> except FirmTrainingSet . DoesNotExist : <EOL> fts = FirmTrainingSet ( firm = firm ) <EOL> fts . save ( ) <EOL> return fts <EOL> class Bio ( models . Model ) : <EOL> firm = models . ForeignKey ( Firm ) <EOL> name = models . TextField ( ) <EOL> bio_text = ArrayField ( models . TextField ( ) , blank = True ) <EOL> url = models . URLField ( ) <EOL> position = models . PositiveIntegerField ( default = <NUM_LIT:0> ) <EOL> automated = models . BooleanField ( default = True ) <EOL> class Meta : <EOL> unique_together = ( "<STR_LIT:url>" , "<STR_LIT>" ) </s>
