Beispiel #1
0
class PermissionGroup(models.Model):
    """
	权限组
	"""
    name = models.CharField(default='', max_length=512, unique=True)  # 组名
    desc = models.CharField(default='', max_length=1024)  #描述

    class Meta(object):
        table_name = 'rust_permission_group'
Beispiel #2
0
class Permission(models.Model):
    """
	资源权限
	"""
    resource = models.CharField(default='', max_length=128)  # 资源名
    method = models.CharField(default='GET', max_length=32)  # 方法名
    created_at = models.DateTimeField(auto_now_add=True)  # 更新时间

    class Meta(object):
        table_name = 'rust_permission'
Beispiel #3
0
class DynamicResource(models.Model):
    """
	动态资源
	"""
    dynamic_id = models.IntegerField(default=0, index=True)  # 动态id
    url = models.CharField(max_length=1024)  # 资源url
    size = models.CharField(max_length=64, default='')  # 资源大小
    type = models.IntegerField(default=DYNAMIC_RESOURCE_TYPE['IMAGE'])  # 资源类型

    class Meta(object):
        table_name = 'dynamic_resource'
Beispiel #4
0
class User(models.Model):
    """
    用户
    """
    username = models.CharField(default='', max_length=128)  #用户名
    password = models.CharField(default='', max_length=1024)  #密码
    nickname = models.CharField(default='', max_length=512)  #用户昵称
    avatar = models.TextField(default='')  #头像
    is_manager = models.BooleanField(default=False)  # 是否管理员
    created_at = models.DateTimeField(auto_now_add=True)  #创建时间

    class Meta(object):
        table_name = 'rust_user'
Beispiel #5
0
class Topic(models.Model):
    """
	话题
	"""
    name = models.CharField(default='', max_length=128)  # 名称
    avatar = models.TextField(default='')  # 头像
    description = models.TextField(default='')  # 描述
    created_at = models.DateTimeField(auto_now_add=True)  # 创建时间
    is_banned = models.BooleanField(default=False)  # 禁用情况

    class Meta(object):
        table_name = 'topic_topic'