from django.db import models
import datetime
# Create your models here.
class FundInfo(models.Model):
    code = models.CharField(max_length=10)  #基金代码
    name = models.CharField(max_length=100) #基金名称
    newnet = models.FloatField(default=0)   #最新净值
    totalnet = models.FloatField(default=0) #累计净值
    dayincrease = models.FloatField(default=0)  #日增长值
    daygrowrate = models.FloatField(default=0)  #日增长率%
    weekgrowrate = models.FloatField(default=0) #周增长率%
    monthgrowrate = models.FloatField(default=0)    #月增长率%
    annualincome = models.FloatField(default=0) #本年收益率%
    time = models.DateTimeField(null=True, blank=True) #数据日期
    addtime = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.code

    class Mate:
        ordering = ['-code','-addtime']
