class MobileHistory(models.Model): type = models.PositiveSmallIntegerField( u'设备类型', choices=((MOBILE_TYPE_APPLE_PHONE, u'iphone'), (MOBILE_TYPE_APPLE_PAD, u'ipad'), (MOBILE_TYPE_ANDROID_PHONE, u'android phone'), (MOBILE_TYPE_ANDROID_PAD, u'android pad'))) version = models.CharField(u'版本', max_length=20) url = models.CharField(u'版本下载路径', max_length=DB_URL_LEN_LIMIT, blank=True, null=True) version_info = models.CharField(u'版本信息', max_length=800, blank=True, null=True) # support html download_count = models.IntegerField(u'下载次数', default=0) # 该版本总的下载次数 upgrade_count = models.IntegerField(u'更新次数', default=0) # 该版本更新安装次数 create_time = models.DateTimeField(u'版本发布时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'mobile_history' verbose_name_plural = u'移动端历史版本表' verbose_name = u'移动端历史版本表' def __unicode__(self): return 'Version(%s)' % self.version
class MomentCircleClass(models.Model): moment = models.ForeignKey(MomentBase, verbose_name=u'互动基础对象', related_name='classcircle', on_delete=models.PROTECT) clazz = models.ForeignKey(Class, verbose_name=u'分享到的班级', related_name='classcircle', on_delete=models.PROTECT) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment_circle_class' verbose_name_plural = u'分享到班级圈表' verbose_name = u'分享到班级圈表' def __unicode__(self): return self.moment
class MomentVoteItem(models.Model): vote = models.ForeignKey(MomentVote, verbose_name=u'投票对象', related_name='items', on_delete=models.PROTECT) branch = models.CharField(u'选择支', max_length=120, default='') sort = models.PositiveSmallIntegerField(u'选择支排序', default=100) count = models.PositiveIntegerField(u'被选择次数', default=0) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment_vote_item' verbose_name_plural = u'投票选择支表' verbose_name = u'投票选择支表' def __unicode__(self): return self.branch
class MomentEvaluate(models.Model): moment = models.ForeignKey(MomentBase, verbose_name=u'互动基础对象', on_delete=models.PROTECT) type = models.PositiveSmallIntegerField( u'评价类型', default=MOMENT_EVALUATE_ZAN, choices=((MOMENT_EVALUATE_ZAN, u'表扬'), (MOMENT_EVALUATE_CAI, u'批评'))) is_visible_for_parent_related = models.PositiveSmallIntegerField( u'仅相关家长可见', default=TRUE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment_evaluate' verbose_name_plural = u'互动评价表' verbose_name = u'互动评价表' def __unicode__(self): return u'互动评价(%s)' % self.content
class MomentVote(models.Model): moment = models.ForeignKey(MomentBase, verbose_name=u'互动基础对象', related_name='votes', on_delete=models.PROTECT) vote_title = models.CharField(u'投票主题', max_length=2000, default='') vote_num = models.PositiveSmallIntegerField(u'多选个数', default=1) # 默认单选 vote_deadline = models.DateTimeField(u'投票截止时间', blank=True, null=True) # 为空表示无限期 vote_statistics = models.IntegerField(u'投票次数统计', default=0) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment_vote' verbose_name_plural = u'互动投票表' verbose_name = u'互动投票表' def __unicode__(self): return 'vote of moment [%s], title=%s, id=%d' % ( self.moment, self.vote_title, self.id)
class MomentAttachVoice(models.Model): moment = models.ForeignKey(MomentBase, verbose_name=u'互动基础对象', related_name='voices', on_delete=models.PROTECT) voice = models.ForeignKey(SysVoice, verbose_name=u'语音', related_name='moments_attached', on_delete=models.PROTECT) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment_voice' verbose_name_plural = u'互动包含的语音表' verbose_name = u'互动包含的语音表' def __unicode__(self): return 'voice of moment [%s], id=%d' % (self.moment, self.id)
class MomentDayoff(models.Model): moment = models.ForeignKey(MomentBase, verbose_name=u'互动基础对象', on_delete=models.PROTECT) is_visible_for_teacher = models.PositiveSmallIntegerField( u'仅教师可见', default=TRUE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment_dayoff' verbose_name_plural = u'互动请假表' verbose_name = u'互动请假表' def __unicode__(self): return u'互动请假(%s)' % self.content
class MomentEvaluateStudent(models.Model): moment = models.ForeignKey(MomentBase, verbose_name=u'互动基础对象', on_delete=models.PROTECT) moment_evaluate = models.ForeignKey(MomentEvaluate, verbose_name=u'互动评价', on_delete=models.PROTECT) student = models.ForeignKey(Student, verbose_name=u'学生', on_delete=models.PROTECT) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment_evaluate_student' verbose_name_plural = u'互动评价学生表' verbose_name = u'互动评价学生表' def __unicode__(self): return u'互动评价学生(%s)' % self.student.full_name
class MomentRead(models.Model): moment = models.ForeignKey(MomentBase, verbose_name=u'互动基础对象', related_name='readers', on_delete=models.PROTECT) account = models.ForeignKey(Account, verbose_name=u'浏览用户', on_delete=models.PROTECT) user_type = models.PositiveSmallIntegerField( u'浏览用户的类型', default=USER_TYPE_NONE, choices=((USER_TYPE_NONE, u'未设置'), (USER_TYPE_STUDENT, u'学生'), (USER_TYPE_TEACHER, u'教师'), (USER_TYPE_PARENT, u'家长'))) user_school = models.ForeignKey(School, verbose_name=u'浏览用户的学校') create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment_read' verbose_name_plural = u'浏览表' verbose_name = u'浏览表' def __unicode__(self): return 'account: %s, school: %s, type: %d read moment [%s]' \ % (self.account, self.user_school, self.user_type, self.moment)
class MomentVoteUser(models.Model): account = models.ForeignKey(Account, verbose_name=u'投票用户', on_delete=models.PROTECT) user_type = models.PositiveSmallIntegerField( u'投票的用户当时的类型', default=USER_TYPE_NONE, choices=((USER_TYPE_NONE, u'未设置'), (USER_TYPE_STUDENT, u'学生'), (USER_TYPE_TEACHER, u'教师'), (USER_TYPE_PARENT, u'家长'))) user_school = models.ForeignKey(School, verbose_name=u'投票用户的学校') vote_item = models.ForeignKey(MomentVoteItem, verbose_name=u'投票选择支', related_name='voter', on_delete=models.PROTECT) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment_vote_user' verbose_name_plural = u'用户投票表' verbose_name = u'用户投票表' def __unicode__(self): return 'account: %s, school: %s, type: %d select item [%s]' \ % (self.account, self.user_school, self.user_type, self.vote_item)
class SysVideo(models.Model): video_name = models.CharField(u'名称', max_length=100, blank=True, null=True) video_size = models.CharField(u'大小', max_length=10, default='0') # 字节 video_duration = models.CharField(u'时长', max_length=10, default='0') # 秒 video_url = models.CharField(u'视频原始URL', max_length=DB_URL_LEN_LIMIT) video_converted_url = models.CharField(u'压缩转码后URL', max_length=DB_URL_LEN_LIMIT, blank=True, null=True) video_converted_status = models.PositiveSmallIntegerField(u'压缩转码状态', \ choices=((VIDEO_CONVERT_STATUS_NONE, u'未压缩转码'), (VIDEO_CONVERT_STATUS_ING, u'正在压缩转码'), (VIDEO_CONVERT_STATUS_SUCC, u'压缩转码成功'), (VIDEO_CONVERT_STATUS_FAIL, u'压缩转码失败'))) video_snapshot_url = models.CharField(u'截图封面URL', max_length=DB_URL_LEN_LIMIT, blank=True, null=True) video_snapshot_status = models.PositiveSmallIntegerField(u'截图状态', \ choices=((VIDEO_SNAPSHOT_STATUS_NONE, u'未服务器截图'), (VIDEO_SNAPSHOT_STATUS_ING, u'正在服务器截图'), (VIDEO_SNAPSHOT_STATUS_SUCC, u'服务器截图成功'), (VIDEO_SNAPSHOT_STATUS_FAIL, u'服务器截图失败'))) video_square = models.CharField(u'视频长宽', max_length=30, default='0,0') # width,length video_type = models.CharField(u'视频类型', max_length=100, default='') account = models.ForeignKey(Account, verbose_name=u'上传用户', on_delete=models.PROTECT) user_type = models.PositiveSmallIntegerField( u'上传用户的类型', default=USER_TYPE_NONE, choices=((USER_TYPE_NONE, u'未设置'), (USER_TYPE_STUDENT, u'学生'), (USER_TYPE_TEACHER, u'教师'), (USER_TYPE_PARENT, u'家长'))) user_school = models.ForeignKey(School, verbose_name=u'上传用户的学校') is_protected = models.PositiveSmallIntegerField(u'是否受保护', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_common_video' verbose_name_plural = u'视频表' verbose_name = u'视频表' def __unicode__(self): return '%d: %s' % (self.id, self.video_name)
class MobileService(models.Model): code = models.CharField(u'关键字', max_length=100, blank=True, null=True) support_user_type = models.PositiveSmallIntegerField(u'支持用户类型', default=USER_TYPE_ALL) support_device = models.PositiveSmallIntegerField(u'支持移动端设备', default=MOBILE_TYPE_ALL) login_url = models.CharField(u'登录地址', max_length=DB_URL_LEN_LIMIT, blank=True, null=True) logout_url = models.CharField(u'登出地址', max_length=DB_URL_LEN_LIMIT, blank=True, null=True) is_heartbeat = models.PositiveSmallIntegerField(u'是否需要心跳', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) heartbeat_interval = models.CharField(u'心跳周期(秒)', max_length=10, blank=True, null=True) heartbeat_url = models.CharField(u'心跳地址', max_length=DB_URL_LEN_LIMIT, blank=True, null=True) para = models.CharField(u'参数(json)', max_length=2000, blank=True, null=True) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'mobile_service' verbose_name_plural = u'移动端服务定义表' verbose_name = u'移动端服务定义表' def __unicode__(self): return 'MobileService(%s)' % self.code
class SysImage(models.Model): image_name = models.CharField(u'名称', max_length=100, blank=True, null=True) image_size = models.CharField(u'大小', max_length=10, default='0') # 字节 image_square = models.CharField(u'长宽', max_length=30, default='0,0') # width,length image_original_url = models.CharField(u'原始图片URL', max_length=DB_URL_LEN_LIMIT) image_thumb_url = models.CharField(u'缩略图片URL', max_length=DB_URL_LEN_LIMIT, blank=True, null=True) # 缩略图 image_crop_url = models.CharField(u'正方形裁剪图片URL', max_length=DB_URL_LEN_LIMIT, blank=True, null=True) # 裁剪图 image_type = models.CharField(u'图片类型', max_length=100, default='') account = models.ForeignKey(Account, verbose_name=u'上传用户', on_delete=models.PROTECT) user_type = models.PositiveSmallIntegerField( u'上传用户的类型', default=USER_TYPE_NONE, choices=((USER_TYPE_NONE, u'未设置'), (USER_TYPE_STUDENT, u'学生'), (USER_TYPE_TEACHER, u'教师'), (USER_TYPE_PARENT, u'家长'))) user_school = models.ForeignKey(School, verbose_name=u'上传用户的学校') is_protected = models.PositiveSmallIntegerField(u'是否受保护', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_common_image' verbose_name_plural = u'图片表' verbose_name = u'图片表' def __unicode__(self): return '%d: %s' % (self.id, self.image_name)
class SysVoice(models.Model): voice_name = models.CharField(u'名称', max_length=100, blank=True, null=True) voice_size = models.CharField(u'大小', max_length=10, default='0') # 字节 voice_duration = models.CharField(u'时长', max_length=8, default='0') # 秒 voice_url = models.CharField(u'语音URL', max_length=DB_URL_LEN_LIMIT) voice_type = models.CharField(u'语音类型', max_length=100, default='') voice_converted_url = models.CharField(u'转码后URL', max_length=DB_URL_LEN_LIMIT, blank=True, null=True) voice_converted_status = models.PositiveSmallIntegerField(u'转码状态', \ choices=((VOICE_CONVERT_STATUS_NONE, u'未转码'), (VOICE_CONVERT_STATUS_ING, u'正在转码'), (VOICE_CONVERT_STATUS_SUCC, u'转码成功'), (VOICE_CONVERT_STATUS_FAIL, u'转码失败'))) account = models.ForeignKey(Account, verbose_name=u'上传用户', on_delete=models.PROTECT) user_type = models.PositiveSmallIntegerField( u'上传用户的类型', default=USER_TYPE_NONE, choices=((USER_TYPE_NONE, u'未设置'), (USER_TYPE_STUDENT, u'学生'), (USER_TYPE_TEACHER, u'教师'), (USER_TYPE_PARENT, u'家长'))) user_school = models.ForeignKey(School, verbose_name=u'上传用户的学校') is_protected = models.PositiveSmallIntegerField(u'是否受保护', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_common_voice' verbose_name_plural = u'语音表' verbose_name = u'语音表' def __unicode__(self): return '%d: %s' % (self.id, self.voice_name)
class NotifyAttachVoice(models.Model): notify = models.ForeignKey(NotifyBase, verbose_name=u'通知基本对象', related_name='voices', on_delete=models.PROTECT) voice = models.ForeignKey(SysVoice, verbose_name=u'通知包含的语音', on_delete=models.PROTECT) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_notify_voice' verbose_name_plural = u'通知语音表' verbose_name = u'通知语音表' def __unicode__(self): return u'通知语音(%s)' % self.voice.id
class NotifyUserStudent(models.Model): notify = models.ForeignKey(NotifyBase, verbose_name=u'通知基本对象', on_delete=models.PROTECT) student = models.ForeignKey(Student, verbose_name=u'学生', on_delete=models.PROTECT) is_read = models.PositiveSmallIntegerField(u'是否已读', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_notify_user_student' verbose_name_plural = u'通知学生表' verbose_name = u'通知学生表' def __unicode__(self): return u'通知学生(%s, %s)' % (self.notify.id, self.student.full_name)
class MobileDef(models.Model): type = models.PositiveSmallIntegerField( u'设备', choices=((MOBILE_TYPE_APPLE_PHONE, u'iphone'), (MOBILE_TYPE_APPLE_PAD, u'ipad'), (MOBILE_TYPE_ANDROID_PHONE, u'android phone'), (MOBILE_TYPE_ANDROID_PAD, u'android pad'))) user_agent = models.CharField(u'http-user-agent关键字', max_length=500, blank=True, null=True) #用逗号分割 latest_version = models.CharField(u'当前最新版本', max_length=20) # a.b.c latest_version_checksum = models.CharField(u'安装包校验', max_length=200, blank=True, null=True) latest_version_url = models.CharField(u'当前版本下载路径', max_length=DB_URL_LEN_LIMIT, blank=True, null=True) support_version = models.CharField(u'服务器支持的最后版本', max_length=20) # a.b.c 低于此版本需强制更新 version_info = models.CharField(u'版本信息', max_length=800, blank=True, null=True) # support html create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'mobile_version' verbose_name_plural = u'移动端下载表' verbose_name = u'移动端下载表' def __unicode__(self): return 'LatestVersion(%s)' % self.latest_version
class GlobalPara(models.Model): key = models.CharField(u'键', max_length=100, blank=True, null=True) value = models.CharField(u'值', max_length=5000, blank=True, null=True) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_global' verbose_name_plural = u'全局参数定义表' verbose_name = u'全局参数定义表' def __unicode__(self): return '%s:%s' % (self.key, self.value)
class SysFile(models.Model): file_name = models.CharField( u'名称', max_length=100, default='', ) file_size = models.CharField(u'大小', max_length=10, default='0') # 字节 file_url = models.CharField(u'文件URL', max_length=DB_URL_LEN_LIMIT) file_type = models.CharField(u'文件类型', max_length=100, default='') account = models.ForeignKey(Account, verbose_name=u'上传用户', on_delete=models.PROTECT) user_type = models.PositiveSmallIntegerField( u'上传用户的类型', default=USER_TYPE_NONE, choices=((USER_TYPE_NONE, u'未设置'), (USER_TYPE_STUDENT, u'学生'), (USER_TYPE_TEACHER, u'教师'), (USER_TYPE_PARENT, u'家长'))) user_school = models.ForeignKey(School, verbose_name=u'上传用户的学校') is_protected = models.PositiveSmallIntegerField(u'是否受保护', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_common_file' verbose_name_plural = u'文件表' verbose_name = u'文件表' def __unicode__(self): return '%d: %s' % (self.id, self.file_name)
class MomentReply(models.Model): moment = models.ForeignKey(MomentBase, verbose_name=u'被评论的互动', related_name='replyers', on_delete=models.PROTECT) account = models.ForeignKey(Account, verbose_name=u'评论用户', on_delete=models.PROTECT) user_type = models.PositiveSmallIntegerField( u'评论用户的类型', default=USER_TYPE_NONE, choices=((USER_TYPE_NONE, u'未设置'), (USER_TYPE_STUDENT, u'学生'), (USER_TYPE_TEACHER, u'教师'), (USER_TYPE_PARENT, u'家长'))) user_school = models.ForeignKey(School, verbose_name=u'评论用户的学校') ref = models.ForeignKey('self', verbose_name=u'被回复的评论', blank=True, null=True) # 递归外键引用 content = models.CharField(u'评论内容', max_length=2000, default='') create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment_reply' verbose_name_plural = u'评论表' verbose_name = u'评论表' def __unicode__(self): return 'account: %s, school: %s, type: %d reply moment [%s]' \ % (self.account, self.user_school, self.user_type, self.moment)
class SmsCode(models.Model): mobile = models.CharField(u"手机号", max_length=30) code = models.CharField(u"短信验证码", max_length=30, blank=True, null=True) timestamp = models.CharField(u"短信验证码生成时间戳", default="", max_length=30, blank=True, null=True) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.IntegerField(u'是否删除', default=FALSE_INT, choices=((TRUE_INT, u"是"), (FALSE_INT, u"否"))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = "mobile_smscode" verbose_name = u'移动端验证码' verbose_name_plural = u'移动端验证码' def __unicode__(self): return 'SmsCode(%s:%s)' % (self.mobile, self.code)
class NotifyBase(models.Model): account = models.ForeignKey(Account, verbose_name=u'发通知的用户', related_name='notify', on_delete=models.PROTECT) user_type = models.PositiveSmallIntegerField(u'发通知用户类型', default=USER_TYPE_NONE, choices=((USER_TYPE_NONE, u'未设置'), (USER_TYPE_STUDENT, u'学生'), (USER_TYPE_TEACHER, u'教师'), (USER_TYPE_PARENT, u'家长'))) user_school = models.ForeignKey(School, verbose_name=u'发通知用户的学校', related_name='notify', on_delete=models.PROTECT) title = models.CharField(u'通知标题', max_length=200, default='') intro = models.CharField(u'通知摘要', max_length=300, default='') content = models.TextField(u'通知正文', blank=True, null=True, default='') type = models.PositiveSmallIntegerField(u'通知类型', default=NOTIFICATION_CLASS, choices=((NOTIFICATION_CLASS, u'班级通知'), (NOTIFICATION_HOMEWORK, u'作业通知'),)) scope = models.PositiveSmallIntegerField(u'通知范围', default=NOTIFICATION_SCOPE_1, choices=((NOTIFICATION_SCOPE_1, u'通知学生,仅家长可读'), (NOTIFICATION_SCOPE_2, u'通知学生,学生和家长可读'),)) remind_count = models.PositiveSmallIntegerField(u'提醒次数', default=1) has_voice = models.PositiveSmallIntegerField(u'是否包含语音', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) has_image = models.PositiveSmallIntegerField(u'是否包含照片', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) has_video = models.PositiveSmallIntegerField(u'是否包含视频', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) has_file = models.PositiveSmallIntegerField(u'是否包含附件', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) create_time = models.DateTimeField(u'通知发送时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_notify' verbose_name_plural = u'通知基本信息表' verbose_name = u'通知基本信息表' def __unicode__(self): return u'通知(%s)' % self.id
class MomentBase(models.Model): account = models.ForeignKey(Account, verbose_name=u'发互动用户', on_delete=models.PROTECT) user_type = models.PositiveSmallIntegerField( u'发互动用户的类型', default=USER_TYPE_NONE, choices=((USER_TYPE_NONE, u'未设置'), (USER_TYPE_STUDENT, u'学生'), (USER_TYPE_TEACHER, u'教师'), (USER_TYPE_PARENT, u'家长'))) user_school = models.ForeignKey(School, verbose_name=u'发互动用户的学校') user_name = models.CharField(u'姓名', max_length=30, blank=True, null=True, default='') content = models.TextField(u'互动文字', blank=True, null=True, default='') moment_type = models.PositiveSmallIntegerField( u'互动类型', default=MOMENT_TYPE_NONE, choices=((USER_TYPE_NONE, u'未定义'), (MOMENT_TYPE_IMAGE, u'照片互动'), (MOMENT_TYPE_VIDEO, u'视频互动'), (MOMENT_TYPE_FILE, u'附件互动'), (MOMENT_TYPE_VOTE, u'投票互动'), (MOMENT_TYPE_MEDAL, u'奖章互动'), (MOMENT_TYPE_DAYOFF, u'请假互动'), (MOMENT_TYPE_EVALUATE, u'评价互动'))) has_voice = models.PositiveSmallIntegerField(u'是否包含语音', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) has_image = models.PositiveSmallIntegerField(u'是否包含照片', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) has_video = models.PositiveSmallIntegerField(u'是否包含视频', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) has_file = models.PositiveSmallIntegerField(u'是否包含附件', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) append_attr = models.TextField(u'附加属性', blank=True, null=True, default='') # 暂未使用 read_count = models.PositiveIntegerField(u'被浏览次数', default=0) like_count = models.PositiveIntegerField(u'被点赞次数', default=0) reply_count = models.PositiveIntegerField(u'含评论个数', default=0) is_public = models.PositiveSmallIntegerField(u'是否公开', default=TRUE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) create_time = models.DateTimeField(u'创建时间', auto_now_add=True) update_time = models.DateTimeField(u'修改时间', auto_now=True) is_del = models.PositiveSmallIntegerField(u'删除否', default=FALSE_INT, choices=((TRUE_INT, u'是'), (FALSE_INT, u'否'))) objects = ManagerFilterDelete() builtin = models.Manager() class Meta: db_table = 'interact_moment' verbose_name_plural = u'互动基础信息表' verbose_name = u'互动基础信息表' def __unicode__(self): return self.content[:20]