class ADR_STUDENTS(models.Model): ADR_CP =models.IntegerField() ADR_VILLE =models.CharField(max_length=120) ADR_PAYS =models.CharField(max_length=2) ID_ANO =models.IntegerField() idCSV =models.IntegerField(blank=True, null=True) objects =DataFrameManager() pdobjects = DataFrameManager() class Meta: db_table='ADR_STUDENTS'
class PRG_STUDENT_SITE(models.Model): ID_ANO =models.IntegerField() PRG =models.CharField(max_length=120) ANNE_SCOLAIRE=models.CharField(max_length=120) SITE =models.CharField(max_length=120) idCSV =models.IntegerField(blank=True, null=True) #objects =models.Manager() objects =DataFrameManager() pdobjects =DataFrameManager() class Meta: db_table = 'PRG_STUDENT_SITE'
class HealthEvent(models.Model): author = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) when = models.DateTimeField(auto_now_add=True) symptoms = models.ManyToManyField( Symptom, related_name="symptoms", blank=True, help_text="hold command or ctrl key to select more than one symptom", ) temperature = models.FloatField( verbose_name="what is your temperature right now", blank=True, null=True, help_text="temperature in Farenheit please, 1 or more decimal places", ) note = models.TextField( verbose_name="Are there any notes related to this event?", blank=True, null=True) # feels_rating = models.IntegerField( # blank=True, # null=True, # help_text="How bad do you feel? Enter a number between 0 and 10, where 10 is bad, 0 is good", # ) objects = DataFrameManager() def __str__(self): return f"{self.author.first_name} - @{self.when}" def get_absolute_url(self): return reverse("stat_detail", args=[str(self.id)]) def get_symptoms(self): return self.symptoms.all()
class SampleTag(models.Model): sample = models.ForeignKey('legacy.Sample', blank=True, null=True) series_tag = models.ForeignKey(SeriesTag, blank=True, null=True, related_name='sample_tags') annotation = models.TextField(blank=True) is_active = models.BooleanField(default=True) created_on = models.DateTimeField(blank=True, null=True, auto_now_add=True) created_by = models.ForeignKey('core.User', db_column='created_by', blank=True, null=True, related_name='sample_annotations') modified_on = models.DateTimeField(blank=True, null=True, auto_now=True) modified_by = models.ForeignKey('core.User', db_column='modified_by', blank=True, null=True, related_name='+') objects = DataFrameManager() class Meta: db_table = 'sample_tag'
class Algorithm(models.Model): key_name = models.CharField( max_length=32, unique=True, ) key_name_is_read_only = models.BooleanField( default=False, ) public = models.BooleanField( help_text=_('Can it be seen by everyone?'), default=False, ) id_order = models.IntegerField( default=0 ) can_be_executed = models.BooleanField( help_text=_('Is the algorithm can be executed on this computer'), default=True, ) objects = DataFrameManager() def __str__(self): return self.name @property def name(self): return ugettext(self.key_name) @property def desc(self): return ugettext(self.key_name + "_desc") def get_instance(self): return get_algo_from(self.key_name)()
class Stocks(models.Model): Asset = models.CharField( max_length=10, help_text= 'Qual o ativo voce quer analisar? Exemplo: petr4 para analisar Petrobras', blank=False) Nome_da_Empresa = models.CharField(max_length=200, help_text='Qual o nome da sua empresa?', blank=False) email = models.EmailField(max_length=200, help_text='Qual o seu e-mail?', blank=False) Seu_nome = models.CharField(max_length=200, help_text='Qual o seu nome?', blank=False) Seu_cargo = models.CharField(max_length=200, help_text='Qual o seu cargo?', blank=False) Segmento = models.CharField(max_length=12, choices=SEGMENTO, help_text='Insira seu segmento') Dicas = models.CharField( max_length=12, choices=DICAS, help_text='Gostaria de receber dicas de Investimento?') pdobjects = DataFrameManager() def __str__(self): return self.Nome_da_Empresa
class EntryModel(models.Model): objects = DataFrameManager() coordinates = JSONField() data = JSONField(default=None, null=True, blank=True) dataset = models.ForeignKey(to=DatasetModel, related_name='entries', on_delete=models.CASCADE, default=None, blank=True, null=True) class Meta: verbose_name = _('Entry') verbose_name_plural = _('Entries') @property def coordinates_json(self): return self.coordinates @property def output(self): return { **(self.data if self.data is not None else {}), **(self.coordinates if self.coordinates is not None else {}) } @property def data_json(self): return self.data def accept(self, visitor: 'IngestionVisitor'): visitor.visit_entry(self)
class Selic(models.Model): Date = models.DateField() Value = models.FloatField(null=True, blank=True, default=None) pdobjects = DataFrameManager() def __float__(self): return self.Value
class WeeklyStockStats(models.Model): company = models.ForeignKey('Company', on_delete=models.CASCADE) date = models.DateField(null=False) day_high = models.FloatField(null=True, blank=True) day_low = models.FloatField(null=True, blank=True) mean = models.FloatField(null=True, blank=True) std_dev = models.FloatField(null=True, blank=True) rsi = models.FloatField(null=True, blank=True) macd = models.FloatField(null=True, blank=True) stochastic = models.FloatField(null=True, blank=True) roc = models.FloatField(null=True, blank=True) willr = models.FloatField(null=True, blank=True) mfi = models.FloatField(null=True, blank=True) atr = models.FloatField(null=True, blank=True) adx = models.FloatField(null=True, blank=True) bol_high = models.FloatField(null=True, blank=True) bol_low = models.FloatField(null=True, blank=True) sma_5 = models.FloatField(null=True, blank=True) sma_10 = models.FloatField(null=True, blank=True) sma_20 = models.FloatField(null=True, blank=True) sma_50 = models.FloatField(null=True, blank=True) sma_100 = models.FloatField(null=True, blank=True) sma_200 = models.FloatField(null=True, blank=True) objects = DataFrameManager() class Meta: unique_together = ['company', 'date']
class Results(models.Model): # 결과 모델 result_id = models.AutoField(primary_key=True) # result_id, pk user_id = models.ForeignKey( User, on_delete=models.CASCADE) # 내부 DB에 있는 USER 연동. foreignKey """어떤 user의 result 인지 알아야 하기 때문""" objects = models.Manager() rsobjects = DataFrameManager() # 데이터프레임 저장
class WeeklyPrice(models.Model): date = models.DateField(null=False) open_price = models.FloatField() high_price = models.FloatField() low_price = models.FloatField() close_price = models.FloatField() wap = models.FloatField(null=True, blank=True) volume = models.PositiveIntegerField(null=True, blank=True) trades = models.PositiveIntegerField(null=True, blank=True) turnover = models.FloatField(null=True, blank=True) deliverable_quantity = models.IntegerField(null=True, blank=True) percent_del_traded_qty = models.FloatField(null=True, blank=True) spread_highLow = models.FloatField(null=True, blank=True) spread_closeOpen = models.FloatField(null=True, blank=True) created_at = models.DateTimeField(auto_now_add=True, null=True, blank=True) company = models.ForeignKey('Company', on_delete=models.CASCADE) objects = DataFrameManager() class Meta: unique_together = ['company', 'date'] def __str__(self): return (self.company.bom_id + " " + self.date.strftime("%m/%d/%Y") + " " + str(self.open_price))
class Content(models.Model): ''' Example in CSV { "dtcreated": "2014-11-11 12:37:49.300", "end_date": "NULL", "cnthndlr_handle": "resource/x-turnitin-assignment", "\ufeffpk1": "1174562", "dtmodified": "2014-11-20 18:11:27.530", "start_date": "2014-11-11 12:37:00.000" } ''' # pk1 id = models.PositiveIntegerField(primary_key=True, db_column='pk1') # cnthndlr_handle handle = models.CharField(max_length=256, db_column='cnthndlr_handle') # start_date date_start = models.DateTimeField(null=True, blank=True, db_column='start_date') # end_date date_end = models.DateTimeField(null=True, blank=True, db_column='end_date') # dtcreated date_created = models.DateTimeField(db_column='dtcreated') # dtmodified date_modified = models.DateTimeField(db_column='dtmodified') objects = DataFrameManager()
class Assessment(models.Model): ''' Example in CSV { "aggregation_model": "1", "point_possible": "60", "\ufeffgradebook_main_pk1": "473159" } ''' AGGREGATION_MODEL = [ 'Last Graded Attempt', 'Highest Attempt (highest grade)', 'Lowest Attempt', 'First Graded Attempt', 'Average' ] AGGREGATION_MODEL_CHOICES = zip(AGGREGATION_MODEL, AGGREGATION_MODEL) # gradebook_main_pk1 gradebook_main = models.PositiveIntegerField( primary_key=True, db_column='gradebook_main_pk1') # point_possible point_possible = models.IntegerField() # aggregation_mode aggregation_model = models.CharField(max_length=64, choices=AGGREGATION_MODEL_CHOICES) objects = DataFrameManager()
class Author(models.Model): """ used to manage artworks authors """ name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) objects = DataFrameManager()
class DigitrafficCommon(models.Model): geojson = models.LineStringField(dim=3, srid=4326) # Non-model fields objects = DataFrameManager() def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.old_geojson = self.geojson self.period = settings.DIGITRAFFIC.get("PERIOD_HOURS") * 60 * 60 * 1000 def filter_geojson(self): created = not self.pk # Join line with previous one if not created and self.old_geojson != self.geojson: self.geojson = self.old_geojson + self.geojson # Filter based on period if self.geojson.z[-1] - self.geojson.z[0] >= self.period: for i in range(len(self.geojson)): if self.geojson.z[-1] - self.geojson.z[i] <= self.period: if len(self.geojson) - i > 2: self.geojson = LineString(self.geojson[i:]) break class Meta: abstract = True
class mergedTables(models.Model): # id =models.IntegerField() ID_ANO =models.CharField(max_length=120) PRG =models.CharField(max_length=120) ANNEE_SCOLAIRE =models.CharField(max_length=120) SITE =models.CharField(max_length=120) ADR_CP =models.CharField(max_length=120) ADR_VILLE =models.CharField(max_length=120) ADR_PAYS =models.CharField(max_length=120) ANNEE =models.CharField(max_length=120) ENTREPRISE =models.CharField(max_length=120) CODE_POSTAL =models.CharField(max_length=120) VILLE =models.CharField(max_length=120) PAYS =models.CharField(max_length=120) SUJET =models.CharField(max_length=120) REMUNERATION =models.CharField(max_length=120) ENT_LAT =models.FloatField(blank=True,null=True) ENT_LON =models.FloatField(blank=True,null=True) ADR_LAT =models.FloatField(blank=True,null=True) ADR_LON =models.FloatField(blank=True,null=True) SITE_LAT =models.FloatField(blank=True,null=True) SITE_LON =models.FloatField(blank=True,null=True) home_campus =models.FloatField(blank=True,null=True) home_entreprise =models.FloatField(blank=True,null=True) campus_entreprise =models.FloatField(blank=True,null=True) idCSV =models.IntegerField(blank=True,null=True) idCSVDescript =models.CharField(max_length=120,blank=True,null=True) objects = models.Manager() pdobjects = DataFrameManager() class Meta: db_table = 'mergedtables'
class Duplicate(Product): objects = DuplicateManager() hpdobjects = DataFrameManager() class Meta: proxy = True verbose_name = 'Duplicate_Hardware'
class Placement(models.Model): placement_id = models.AutoField(primary_key=True) placement_name = models.CharField(max_length=100, unique=True) placement_url = models.CharField(max_length=250) placement_description = models.CharField(max_length=140, blank=True, null=True) tactic = models.ForeignKey(Tactic, on_delete=models.PROTECT) medium = models.ForeignKey(Medium, on_delete=models.PROTECT) source = models.ForeignKey(Source, on_delete=models.PROTECT) creative = models.ForeignKey(Creative, blank=True, null=True, on_delete=models.SET_NULL) catid = models.IntegerField(blank=True, null=True) page_cat = models.CharField(max_length=100, blank=True, null=True) page_id = models.CharField(max_length=100, blank=True, null=True) promo_uid = models.IntegerField(blank=True, null=True) ad_network = models.ForeignKey(Ad_Network, blank=True, null=True, on_delete=models.SET_NULL) jira_ticket = models.CharField(max_length=20, blank=True, default="") start_date = models.DateField('Start Date', blank=True, null=True) end_date = models.DateField('End Date', blank=True, null=True) created_on = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) objects = DataFrameManager() def __str__(self): return str(self.placement_id)
class Movies(models.Model): id = models.IntegerField(primary_key=True) belongs_to_collection = models.TextField(default="") budget = models.DecimalField(max_digits=20, decimal_places=2) genres = models.TextField(default="") homepage = models.TextField(default="") imdb_id = models.TextField(default="") original_language = models.TextField(default="") original_title = models.TextField(default="") overview = models.TextField(default="") popularity = models.DecimalField(max_digits=7, decimal_places=2) poster_path = models.TextField(default="") production_companies = models.TextField(default="") production_countries = models.TextField(default="") release_date = models.DateField(default=timezone.now) runtime = models.DecimalField(max_digits=6, decimal_places=2) spoken_languages = models.TextField(default="") status = models.TextField(default="") tagline = models.TextField(default="") title = models.TextField(default="") keywords = models.TextField(default="") cast = models.TextField(default="") crew = models.TextField(default="") revenue = models.DecimalField(max_digits=20, decimal_places=2) objects = DataFrameManager() features = ['budget', 'runtime'] target = ['revenue']
class ShareDailyHistory(models.Model): share = models.ForeignKey(Share, null=False, blank=False, on_delete=models.CASCADE, related_name="history") date = models.DateField(null=False, blank=False, db_index=True) first = models.IntegerField(null=False, blank=False) last = models.IntegerField(null=False, blank=False) close = models.IntegerField(null=False, blank=False) open = models.IntegerField(null=False, blank=False) high = models.IntegerField(null=False, blank=False) low = models.IntegerField(null=False, blank=False) volume = models.BigIntegerField(null=False, blank=False) count = models.BigIntegerField(null=False, blank=False) value = models.BigIntegerField(null=False, blank=False) objects = DataFrameManager() class Meta: unique_together = (("share", "date"), ) def __str__(self): return f"{self.share}: {self.date}"
class Country(models.Model): Country = models.CharField(max_length=150) Date = models.DateField() Infected = models.IntegerField() Recovered = models.IntegerField() Dead = models.IntegerField() objects = DataFrameManager()
class Rating(models.Model): user = models.CharField(max_length=20) item = models.ForeignKey(Item) rating = models.IntegerField() timestamp = models.CharField(max_length=64) objects = DataFrameManager()
class Entry(models.Model): CURR = ( ('PHP', 'Phil. Peso'), ('THB', 'Thai Baht'), ('EUR', 'Euro'), ('USD', 'Dollar'), ('CHF', 'Franken'), ) #for later: user = models.ForeignKey(settings.AUTH_USER_MODEL, default=1) date = models.DateField() category = models.ForeignKey('Category') amount = models.FloatField() currency = models.CharField(max_length=3, choices=CURR, default="PHP") curr_out = models.CharField(max_length=3, choices=CURR, default="CHF") comments = models.CharField(max_length=50, null=True, blank=True) amount_out = models.FloatField(null=True, blank=True) curr_out = models.CharField(max_length=3, choices=CURR, default="CHF") objects = DataFrameManager() def __str__(self): return ("%s %s for %s on %s") % (self.amount, self.currency, self.category, self.date) def get_absolute_url(self): return reverse('detail', kwargs={"pk": self.pk})
class PerShare(models.Model): """Per share metrics for listed companies.""" code = models.ForeignKey(Detail) date = models.DateField(null=True) year = models.IntegerField() earnings = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) roe = models.DecimalField(null=True, blank=True, max_digits=10, decimal_places=2) book_value = models.DecimalField(null=True, blank=True, max_digits=10, decimal_places=2) pe = models.DecimalField(null=True, blank=True, max_digits=10, decimal_places=2) market_cap = models.BigIntegerField(null=True, blank=True) shares_outstanding = models.BigIntegerField(null=True, blank=True) total_debt_ratio = models.DecimalField(null=True, blank=True, max_digits=10, decimal_places=2) objects = DataFrameManager() def __unicode__(self): return '{0} - {1}'.format(self.code.code, self.date)
class DuplicateAccessory(ProductAccessory): objects = DuplicateAccessoryManager() acpdobjects = DataFrameManager() class Meta: proxy = True verbose_name = 'Duplicate_Accessory'
class ShareDailyHistory(models.Model): share = models.ForeignKey(Share, null=False, blank=False, on_delete=models.CASCADE, related_name="history") date = models.DateField(null=False, blank=False) first = models.IntegerField(null=False, blank=False) close = models.IntegerField(null=False, blank=False) tomorrow = models.IntegerField(null=False, blank=False) yesterday = models.IntegerField(null=False, blank=False) high = models.IntegerField(null=False, blank=False) low = models.IntegerField(null=False, blank=False) volume = models.BigIntegerField(null=False, blank=False) count = models.BigIntegerField(null=False, blank=False) value = models.BigIntegerField(null=False, blank=False) objects = DataFrameManager() class Meta: unique_together = (("share", "date"), ) def __str__(self): return "{}: {}".format(self.share, self.date)
class DuplicateAVEng(ProductAVEng): objects = DuplicateAVEngManager() avpdobjects = DataFrameManager() class Meta: proxy = True verbose_name = 'Duplicate_AVEng'
class Candle(models.Model): email = models.EmailField(max_length=200, help_text='Qual o seu e-mail?', blank=False) pdobjects = DataFrameManager() def __str__(self): return self.email
class CriterioParametro(models.Model): projeto = models.ForeignKey('Projeto', on_delete=models.CASCADE) criterio = models.ForeignKey('Criterio', on_delete=models.CASCADE) p = models.FloatField() q = models.FloatField() v = models.FloatField() objects = DataFrameManager()
class STUDENT_INTERNSHIP(models.Model): ANNEE =models.CharField(max_length=120) ANNEE_SCOLAIRE =models.CharField(max_length=120) ENTREPRISE =models.CharField(max_length=120) CODE_POSTAL =models.CharField(max_length=120) VILLE =models.CharField(max_length=120) PAYS =models.CharField(max_length=120) SUJET =models.CharField(max_length=120) REMUNERATION =models.FloatField(null=True, blank=True, default=None) ID_ANO =models.IntegerField() idCSV =models.IntegerField(blank=True, null=True) objects =DataFrameManager() pdobjects =DataFrameManager() class Meta: db_table='STUDENT_INTERNSHIP'