# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class User2(models.Model):
user = models.OneToOneField(User)
name = models.CharField(max_length=64)
group = models.ManyToManyField('Groups')
def __str__(self):
return self.user
class Groups(models.Model):
name = models.CharField(max_length=64,unique=True,verbose_name='组别')
def __str__(self):
return self.name
class Movie_para(models.Model):
movie_id = models.CharField(max_length=20)
movie_name = models.CharField(max_length=35,unique=True,verbose_name='电影名称')
cinema_ids = models.ManyToManyField('cinema_para')
movie_time = models.DateTimeField()
status = models.BooleanField(default=None)
def __str__(self):
return self.movie_name
class Cinema_para(models.Model):
cinema_id = models.CharField(max_length=20)
cinema_name = models.CharField(max_length=40,unique=True,verbose_name='影院名称')
cinema_url = models.CharField(max_length=300)
cinema_info = models.CharField(max_length=300)
def __str__(self):
return self.cinema_name
class Piaofangshujk(models.Model):
movie_name = models.CharField(max_length=64)
changci_zhanbi = models.CharField(max_length=64)
wangpiaopf = models.CharField(max_length=64)
hapiaopf = models.CharField(max_length=64)
wandapf = models.CharField(max_length=64)
jinyipf = models.CharField(max_length=64)
xingmeipf = models.CharField(max_length=64)
shishi_pfjine = models.CharField(max_length=64)
yuji_pfjine = models.CharField(max_length=64)
leiji_pfjine = models.CharField(max_length=64)
scrapyTimes = models.CharField(max_length=64, default=None, verbose_name='抓取数据时间')
def __str__(self):
return self.moovie_name
class ShishiDianying(models.Model):
movie_name = models.CharField(max_length=64)
shishi_pfjine = models.CharField(max_length=64)
leiji_pfjine = models.CharField(max_length=64)
shishipiapian = models.CharField(max_length=64)
shishicahngci = models.CharField(max_length=64)
shangyingtianshu = models.IntegerField(default=0)
scrapyTimes = models.CharField(max_length=64, default=None, verbose_name='抓取数据时间')
def __str__(self):
return self.movie_name
class Zhongguodianyinxinxi(models.Model):
filmName = models.CharField(max_length=64)
daySales = models.CharField(max_length=64)
filmTotalSales = models.CharField(max_length=64)
daySession = models.CharField(max_length=64)
dayAudience = models.CharField(max_length=64)
rank = models.CharField(max_length=64)
scrapyTimes = models.CharField(max_length=64, default=None, verbose_name='抓取数据时间')
def __str__(self):
return self.filmName
class Maoyandianying(models.Model):
fileName = models.CharField(max_length=64)
leiji_pfjine = models.CharField(max_length=64)
shishi_prfjin = models.CharField(max_length=64)
piaofangzhanbi = models.CharField(max_length=64)
piaipianzhanbi = models.CharField(max_length=64)
shangzuolv = models.CharField(max_length=64)
scrapyTimes = models.CharField(max_length=64, default=None, verbose_name='抓取数据时间')
def __str__(self):
return self.fileName
class Yiendianyingzhiku(models.Model):
fileName = models.CharField(max_length=64)
ShiShi_pfjine = models.CharField(max_length=64)
piaoFangZhanBi = models.CharField(max_length=64)
leiJi_pfjine = models.CharField(max_length=64)
paiPianZhanBi = models.CharField(max_length=64)
shangYingTianShu = models.CharField(max_length=64)
scrapyTimes = models.CharField(max_length=64, default=None, verbose_name='抓取数据时间')
def __str__(self):
return self.fileName
class MovieTotle(models.Model):
movieName = models.CharField(max_length=64,default=None,verbose_name='电影名称')
shiShi_ticketSale = models.CharField(max_length=64,default=None,verbose_name='实时票房')
totle_ticketSale = models.CharField(max_length=64,default=None,verbose_name='当前总票房')
releasedDate = models.CharField(max_length=64,default=None,verbose_name='上映日期')
showDays = models.CharField(max_length=64,default=None,verbose_name='上映天数')
siteName = models.CharField(max_length=64,default=None,verbose_name='网站名称')
siteUrl = models.CharField(max_length=100,default=None,verbose_name='网站链接')
subDatabaseName = models.CharField(max_length=64,default=None,verbose_name='分库名称')
scrapyTimes = models.CharField(max_length=64,default=None,verbose_name='抓取数据时间')
subId = models.IntegerField(verbose_name='此条数据所在的分库表ID')
screenshotName = models.CharField(max_length=64,default=None,verbose_name='所截图片名称')
screenshotURL = models.CharField(max_length=100,default=None,verbose_name='所截图路径')
def __str__(self):
return self.movieName
Django的module编写小demo一个
最新推荐文章于 2021-06-14 17:32:33 发布