from django.db import models class param(models.Model): param_name = models.CharField(max_length=10, primary_key=True) param_value = models.CharField(max_length=128) class stat(models.Model): id = models.IntegerField(primary_key=True) danmakus = models.IntegerField() favorites = models.IntegerField() views = models.IntegerField() # def json(self): # return bangumi_stat(self['danmakus'],self['favorites'],self['views']) class mediaInfo(models.Model): bangumi_id = models.IntegerField() season_id = models.IntegerField(primary_key=True) media_id = models.IntegerField() chn_name = models.CharField(max_length=128) def __str__(self) -> str: i = {'media_id': self.id, 'chn_name': self.chn_name} return i class bangumi_list(models.Model): season_id = models.IntegerField(primary_key=True) badge = models.CharField(max_length=128) brief = models.CharField(max_length=128) copyright = models.CharField(max_length=128) cover = models.CharField(max_length=128) favorites = models.IntegerField() is_finish = models.IntegerField() newest_ep_index = models.IntegerField() pub_time = models.DateTimeField() season_status = models.IntegerField() title = models.CharField(max_length=128) total_count = models.IntegerField() trailer_aid = models.IntegerField() class rule(models.Model): regex=models.CharField(primary_key=True,max_length=128)