bullish/backend/app/models.py
Ameya Shenoy d8c78bd111
feat: get rq working and schedule job at 6
Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
2021-02-09 18:00:52 +05:30

28 lines
1.1 KiB
Python

from django.db import models
# Create your models here.
class BhavCopyEquity(models.Model):
id = models.AutoField(primary_key=True)
date = models.DateField(auto_now_add=True, editable=False)
# Ref: https://www.bseindia.com/markets/debt/BhavCopyhelp.aspx
sc_code = models.PositiveIntegerField()
sc_name = models.CharField(max_length=20)
sc_group = models.CharField(max_length=2)
sc_type = models.CharField(max_length=1)
open_price = models.DecimalField(max_digits=12, decimal_places=2)
high_price = models.DecimalField(max_digits=12, decimal_places=2)
low_price = models.DecimalField(max_digits=12, decimal_places=2)
close_price = models.DecimalField(max_digits=12, decimal_places=2)
last_price = models.DecimalField(max_digits=12, decimal_places=2)
prevclose_price = models.DecimalField(max_digits=12, decimal_places=2)
no_trades = models.PositiveIntegerField()
no_of_shrs = models.PositiveIntegerField()
net_turnov = models.DecimalField(max_digits=12, decimal_places=2)
tdcloindi = models.TextField(blank=True)
def __str__(self):
return f'{self.date}-{self.sc_code}'