示例#1
0
文件: models.py 项目: cash2one/gaia
class Session(models.Model):
    mpuser = models.ForeignKey(WeixinMpUser, related_name='owned_sessions')
    weixin_user = models.ForeignKey(WeixinUser,
                                    to_field='username',
                                    db_column='weixin_user_username')
    latest_contact_content = models.CharField(max_length=1024)  #最后一次交互消息内容
    latest_contact_created_at = models.DateTimeField(
        auto_now_add=True)  #最后一次交互时间
    is_latest_contact_by_viper = models.BooleanField(
        default=False)  #最后一次交互是否是客户发出的
    unread_count = models.IntegerField(default=0)  #未读消息数
    is_show = models.BooleanField(default=False)  #是否显示(是否填充对应的WeixinUser)
    created_at = models.DateTimeField(auto_now_add=True)
    weixin_created_at = models.CharField(max_length=50)  #微信平台提供的创建时间
    retry_count = models.IntegerField(default=0)  #重試次數
    #add by bert at 20.0
    message_id = models.IntegerField(default=0)
    #add by slzhu
    member_user_username = models.CharField(default='', max_length=100)
    member_message_id = models.IntegerField(default=0)
    member_latest_content = models.CharField(default='',
                                             max_length=1024)  #粉丝最近一条消息
    member_latest_created_at = models.CharField(default='',
                                                max_length=50)  #粉丝最近一条消息时间
    is_replied = models.BooleanField(default=False)  #是否回复过

    class Meta(object):
        ordering = ['-latest_contact_created_at']
        db_table = 'weixin_message_session'
示例#2
0
文件: models.py 项目: cash2one/gaia
class UserProfile(models.Model):
    """
	用户profile
	"""
    user = models.ForeignKey(User)
    manager_id = models.IntegerField(default=0)  #创建该用户的系统用户的id
    webapp_id = models.CharField(max_length=16)
    webapp_type = models.IntegerField(default=0)  #商城类型
    app_display_name = models.CharField(max_length=50,
                                        verbose_name='用于显示app名称',
                                        default='')
    is_active = models.BooleanField(default=True, verbose_name='用户是否有效')
    note = models.CharField(max_length=1024, default='')
    status = models.IntegerField(default=USER_STATUS_NORMAL)
    is_mp_registered = models.BooleanField(default=False,
                                           verbose_name='是否已经接入了公众账号')
    mp_token = models.CharField(max_length=50,
                                verbose_name='绑定公众号使用的token',
                                default='')
    mp_url = models.CharField(max_length=256,
                              verbose_name='公众号绑定的url',
                              default='')
    new_message_count = models.IntegerField(default=0)  #新消息数
    webapp_template = models.CharField(max_length=50,
                                       default='shop')  #webapp的模板
    is_customed = models.IntegerField(default=0)  #是否客户自定义CSS样式:1:是;0:否
    is_under_previewed = models.IntegerField(default=0)  #是否是预览模式:1:是;0:否
    expire_date_day = models.DateField(auto_now_add=True)
    force_logout_date = models.BigIntegerField(default=0)

    host_name = models.CharField(max_length=1024, default="")
    logout_redirect_to = models.CharField(max_length=1024, default="")
    system_name = models.CharField(max_length=64,
                                   default=u'微信营销管理系统',
                                   verbose_name='系统名称')
    system_version = models.CharField(max_length=16,
                                      default=SYSTEM_VERSION_TYPE_BASE,
                                      verbose_name='系统版本')

    homepage_template_name = models.CharField(max_length=250,
                                              default='')  #首页模板名
    backend_template_name = models.CharField(max_length=250,
                                             default='')  #后端页面模板名
    homepage_workspace_id = models.IntegerField(
        default=0)  #homepage workspace的id
    #add by bert
    account_type = models.IntegerField(default=SELF_OPERATION)  #帐号类型
    is_oauth = models.BooleanField(default=False)  #是否授权
    #v2
    sub_account_count = models.IntegerField(default=50)  #可创建的子账号的个数
    #wepage
    is_use_wepage = models.BooleanField(default=False)  #是否启用wepage
    store_name = models.CharField(max_length=64, default="")  #店铺名称
    #结算账期
    settlement_period = models.IntegerField(default=1)
    is_formal = models.BooleanField(default=True)  #账户类型是否是正式账号
    kefu_url = models.CharField(max_length=256, default="")  #客服url

    class Meta(object):
        db_table = 'account_user_profile'
示例#3
0
class CouponRule(models.Model):
    """
	优惠券规则
	"""
    owner = models.ForeignKey(User)
    name = models.CharField(max_length=20)  #名称
    valid_days = models.IntegerField(default=0)  #过期天数
    is_active = models.BooleanField(default=True)  #是否可用
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间
    start_date = models.DateTimeField()  #有效期开始时间
    end_date = models.DateTimeField()  #有效期结束时间
    # v2
    valid_restrictions = models.IntegerField(default=-1)  #订单满多少可以使用规则
    money = models.DecimalField()  #金额
    count = models.IntegerField(default=0)  #发放总数量
    remained_count = models.IntegerField(default=0)  #剩余数量
    limit_counts = models.IntegerField(default=0)  #每人限领
    limit_product = models.BooleanField(default=False)  #限制指定商品
    limit_product_id = models.CharField(max_length=2048, default=0)  #限制指定商品ID
    remark = models.TextField(default='')  #备注
    get_person_count = models.IntegerField(default=0)  #领取人数
    get_count = models.IntegerField(default=0)  #领取次数
    use_count = models.IntegerField(default=0)  #使用次数
    receive_rule = models.BooleanField(default=False)  #领取规则,仅未下单用户可领取

    class Meta(object):
        db_table = 'market_tool_coupon_rule'
示例#4
0
class UserHasMessage(models.Model):
    user = models.ForeignKey(User)
    message = models.ForeignKey(Message)
    is_read = models.BooleanField(default=False)
    message_type = models.BooleanField(default=True)

    class Meta(object):
        db_table = 'message_user_has_message'
        verbose_name = '用户-系统消息'
        verbose_name_plural = '用户-系统消息'
示例#5
0
class Member(models.Model):
    """
	会员
	"""
    token = models.CharField(max_length=255)
    webapp_id = models.CharField(max_length=16)
    username_hexstr = models.CharField(max_length=2048,
                                       verbose_name='会员名称的hex str')
    user_icon = models.CharField(max_length=1024,
                                 verbose_name='会员头像',
                                 default='')
    integral = models.IntegerField(default=0, verbose_name='积分')
    created_at = models.DateTimeField(auto_now_add=True)
    grade = models.ForeignKey(MemberGrade)
    experience = models.IntegerField(default=0, verbose_name='经验值')
    remarks_name = models.CharField(max_length=32,
                                    verbose_name='备注名',
                                    default='')
    remarks_extra = models.TextField(verbose_name='备注信息', default='')
    last_visit_time = models.DateTimeField(auto_now_add=True)
    last_message_id = models.IntegerField(default=-1, verbose_name="最近一条消息id")
    session_id = models.IntegerField(default=-1, verbose_name="会话id")
    is_for_test = models.BooleanField(default=False)
    is_subscribed = models.BooleanField(default=True)
    friend_count = models.IntegerField(default=0)  #好友数量
    factor = models.FloatField(default=0.00)  #社会因子
    source = models.IntegerField(default=-1)  #会员来源
    is_for_buy_test = models.BooleanField(default=False)
    update_time = models.DateTimeField(
        default=datetime.now())  #会员信息更新时间 2014-11-11
    pay_money = models.FloatField(default=0.0)
    pay_times = models.IntegerField(default=0)
    last_pay_time = models.DateTimeField(default=None)  #会员信息更新时间 2014-11-11
    unit_price = models.FloatField(default=0.0)  #ke dan jia
    city = models.CharField(default='', max_length=50)
    province = models.CharField(default='', max_length=50)
    country = models.CharField(default='', max_length=50)
    sex = models.IntegerField(default=0, verbose_name='性别')
    status = models.IntegerField(default=1)
    purchase_frequency = models.IntegerField(default=0)  # 30天购买次数
    cancel_subscribe_time = models.DateTimeField(blank=True,
                                                 null=True,
                                                 default=None,
                                                 verbose_name="取消关注时间")
    fans_count = models.IntegerField(default=0)  #粉丝数量

    class Meta(object):
        db_table = 'member_member'

    def __unicode__(self):
        return u'<member: %s %s>' % (self.webapp_id, self.token)
示例#6
0
class Message(models.Model):
    modules = models.IntegerField(default=MODULES['DATA'])  # 选择模块
    message_type = models.BooleanField(default=True)  # 默认消息中心
    title = models.CharField(max_length=128)  # 标题名
    file_url = models.CharField(max_length=256)  # 上传文件地址
    content = models.TextField()  # 内容
    file_type = models.BooleanField(default=True)  # 上传类型(默认word)
    created_at = models.DateTimeField(auto_now_add=True)  # 添加时间
    owner = models.ForeignKey(User)

    class Meta(object):
        db_table = 'message_message'
        verbose_name = '系统消息'
        verbose_name_plural = '系统消息'
class ExportJob(models.Model):
    woid = models.IntegerField()
    type = models.IntegerField(default=0)
    status = models.BooleanField(default=False)  # 其实是表示是否完成的bool
    processed_count = models.IntegerField()  # 已处理数量
    count = models.IntegerField()  # 总数量
    is_download = models.BooleanField(default=False, verbose_name='是否下载')
    param = models.CharField(max_length=1024)
    file_path = models.CharField(max_length=256)
    update_at = models.DateTimeField(verbose_name='更新时间', auto_now=True)
    created_at = models.DateTimeField(verbose_name='创建时间')

    class Meta(object):
        db_table = 'export_job'
示例#8
0
class ShipInfo(models.Model):
    """
	收货地址
	"""
    webapp_user_id = models.IntegerField(db_index=True, default=0)
    ship_name = models.CharField(max_length=100)  # 收货人姓名
    ship_tel = models.CharField(max_length=100)  # 收货人电话
    ship_address = models.CharField(max_length=200)  # 收货人地址
    area = models.CharField(max_length=256)  #地区
    is_selected = models.BooleanField(default=True)  # 是否选中,默认是选中
    is_deleted = models.BooleanField(default=False)  # 是否被删除
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta(object):
        db_table = 'member_ship_info'
示例#9
0
class TengyiRebateLog(models.Model):
    """
	腾易微众星级会员返利记录表
	"""
    member_id = models.IntegerField(default=0)
    is_self_order = models.BooleanField(default=False)  #是否自己的订单返利
    supply_member_id = models.IntegerField(default=0)  #返利会员id
    is_exchanged = models.BooleanField(default=False)  #是否已返利
    exchanged_at = models.DateTimeField(default=datetime.strptime(
        '2000-01-01', '%Y-%m-%d'))  #返利时间
    rebate_money = models.FloatField(default=0)  #返利金额
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta(object):
        db_table = 'tengyi_rebate_log'
示例#10
0
class User(models.Model):
    """
	从django.contrib.auth.User迁移过来
	"""
    username = models.CharField(max_length=30)
    first_name = models.CharField(max_length=30, default='')
    last_name = models.CharField(max_length=30, default='')
    email = models.EmailField(default='')
    is_staff = models.BooleanField(default=False)
    is_active = models.BooleanField(default=True, )
    date_joined = models.DateTimeField(default=datetime.datetime.now)

    class Meta:
        db_table = 'auth_user'
        verbose_name = 'user'
        verbose_name_plural = 'users'
示例#11
0
文件: models.py 项目: cash2one/gaia
class ComponentInfo(models.Model):
    """
    <xml><AppId><![CDATA[wx984abb2d00cc47b8]]></AppId>
    <CreateTime>1427710810</CreateTime>
    <InfoType><![CDATA[component_verify_ticket]]></InfoType>
    <ComponentVerifyTicket><![CDATA[Z8RBNjttRu3P5eM8rPe9TW3dA09yuAequP1BmbHhITxs8lZ-
    X-Gxwaegr5lcPkfJ4VAiRLiuLlCrhKmIz-oSpw]]></ComponentVerifyTicket>
    </xml>

    <xml><AppId><![CDATA[wx984abb2d00cc47b8]]></AppId>
    <CreateTime>1427710810</CreateTime>
    <InfoType><![CDATA[component_verify_ticket]]></InfoType>
    <ComponentVerifyTicket><![CDATA[Z8RBNjttRu3P5eM8rPe9TW3dA09yuAequP1BmbHhITxs8lZ-
    X-Gxwaegr5lcPkfJ4VAiRLiuLlCrhKmIz-oSpw]]></ComponentVerifyTicket>
    </xml>
    """
    app_id = models.CharField(max_length=64)
    app_secret = models.CharField(max_length=64)
    component_verify_ticket = models.TextField()
    token = models.TextField()
    ase_key = models.TextField()
    last_update_time = models.DateTimeField(default=datetime.now())
    component_access_token = models.TextField()
    is_active = models.BooleanField(default=True)
    access_token_update_time = models.DateTimeField(default=datetime.now())
    verify_ticket_update_time = models.DateTimeField(default=datetime.now())

    def __unicode__(self):
        return self.app_id

    class Meta(object):
        db_table = 'component_info'
        verbose_name = '第三方帐号信息'
        verbose_name_plural = '第三方帐号信息'
示例#12
0
class WeizoomCardRule(models.Model):
    """
	微众卡规则
	"""
    owner = models.ForeignKey(User)
    name = models.CharField(max_length=20, db_index=True)  #名称
    money = models.DecimalField(max_digits=65, decimal_places=2)  #微众卡金额
    count = models.IntegerField(default=0)  #发放总数量
    remark = models.CharField(max_length=20, db_index=True)  #备注
    expired_time = models.DateTimeField()  #过期时间
    valid_time_from = models.DateTimeField()  #有效范围开始时间
    valid_time_to = models.DateTimeField()  #有效范围结束时间
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间
    card_type = models.IntegerField(default=WEIZOOM_CARD_EXTERNAL_USER)  #微众卡类型
    card_attr = models.IntegerField(default=0)  #微众卡属性
    shop_limit_list = models.CharField(max_length=2048, default='-1')  #专属商家
    shop_black_list = models.CharField(max_length=2048,
                                       default='-1')  #不能使用微众卡的商家
    is_new_member_special = models.BooleanField(default=False)  #是否为新会员专属卡
    valid_restrictions = models.DecimalField(max_digits=65,
                                             decimal_places=2)  #订单满多少可以使用规则

    class Meta(object):
        db_table = 'market_tool_weizoom_card_rule'
        verbose_name = '微众卡规则'
        verbose_name_plural = '微众卡规则'
示例#13
0
文件: models.py 项目: cash2one/gaia
class ComponentAuthedAppid(models.Model):
    """
    参数  说明
    authorization_info  授权信息
    authorizer_appid    授权方appid
    authorizer_access_token 授权方令牌(在授权的公众号具备API权限时,才有此返回值)
    expires_in  有效期(在授权的公众号具备API权限时,才有此返回值)
    authorizer_refresh_token    刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于公众号第三方平台获取和刷新已授权用户的access_token,只会在授权时刻提供,请妥善保存。 一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌
    func_info   公众号授权给开发者的权限集列表(请注意,当出现用户已经将消息与菜单权限集授权给了某个第三方,再授权给另一个第三方时,由于该权限集是互斥的,后一个第三方的授权将去除此权限集,开发者可以在返回的func_info信息中验证这一点,避免信息遗漏),
    1到8分别代表:
    1消息与菜单权限集
    2用户管理权限集
    3帐号管理权限集
    4网页授权权限集
    5微信小店权限集
    6多客服权限集
    7业务通知权限集
    8微信卡券权限集

    """
    component_info = models.ForeignKey(ComponentInfo)
    auth_code = models.TextField(default='')
    user_id = models.IntegerField(default=0)  #对应帐号user id
    last_update_time = models.DateTimeField(default=datetime.now())
    authorizer_appid = models.CharField(max_length=255, default='')
    authorizer_access_token = models.TextField(default='')
    authorizer_refresh_token = models.TextField(default='')
    func_info = models.TextField(default='')
    created_at = models.DateTimeField(auto_now=True)
    is_active = models.BooleanField(default=False)

    class Meta(object):
        db_table = 'component_authed_appid'
        verbose_name = '委托授权帐号基本信息'
        verbose_name_plural = '委托授权帐号基本信息'
示例#14
0
文件: models.py 项目: cash2one/gaia
class IntegralStrategySettings(models.Model):
    """
    积分策略配置
    """
    webapp_id = models.CharField(max_length=20)
    click_shared_url_increase_count_after_buy = models.IntegerField(verbose_name='点击分享链接为购买后的分享者增加的额度', default=0)
    click_shared_url_increase_count_before_buy = models.IntegerField(verbose_name='点击分享链接为未购买的分享者增加的额度', default=0)
    buy_increase_count_for_father = models.IntegerField(verbose_name='成为会员增加额度', default=0)
    increase_integral_count_for_brring_customer_by_qrcode = models.IntegerField(verbose_name='使用二维码带来用户增加的额度', default=0)
    integral_each_yuan = models.IntegerField(verbose_name='一元是多少积分', default=0)
    usable_integral_or_conpon = models.IntegerField(verbose_name='积分与优惠券可同时使用', default=USABLE_BOTH)
    #v2
    be_member_increase_count = models.IntegerField(verbose_name='成为会员增加额度', default=0)
    order_money_percentage_for_each_buy = models.CharField(max_length=25, verbose_name="每次购物后,额外积分(以订单金额的百分比计算)", default="0.0")
    buy_via_offline_increase_count_for_author = models.IntegerField(verbose_name='线下会员购买为推荐者增加的额度', default=0)
    click_shared_url_increase_count = models.IntegerField(verbose_name='分享链接给好友点击', default=0)
    buy_award_count_for_buyer = models.IntegerField(verbose_name='购物返积分额度', default=0)
    buy_via_shared_url_increase_count_for_author = models.IntegerField(verbose_name='通过分享链接购买为分享者增加的额度', default=0)
    buy_via_offline_increase_count_percentage_for_author = models.CharField(max_length=25, verbose_name="线下会员购买为推荐者额外增加的额度(以订单金额的百分比计算)", default="0.0")
    use_ceiling = models.IntegerField(default=-1, verbose_name='订单积分抵扣上限')
    review_increase = models.IntegerField(default=0, verbose_name='商品好评送积分')
    is_all_conditions = models.BooleanField(default=False,verbose_name='自动升级条件')

    class Meta(object):
        db_table = 'member_integral_strategy_settings'
示例#15
0
class WeizoomCard(models.Model):
    """
	微众卡存储模型

	@note WeizoomCardHasAccount.account.id即owner_id
	"""
    owner = models.ForeignKey(User)
    target_user_id = models.IntegerField(default=0, verbose_name="微众卡发放目标")
    weizoom_card_rule = models.ForeignKey(WeizoomCardRule)
    status = models.IntegerField(default=WEIZOOM_CARD_STATUS_INACTIVE)  #微众卡状态
    weizoom_card_id = models.CharField(max_length=50)  #微众卡号
    money = models.DecimalField(max_digits=65, decimal_places=2)  #剩余金额
    password = models.CharField(max_length=50)  #微众卡密码
    expired_time = models.DateTimeField()  #过期时间
    is_expired = models.BooleanField(default=False)  #是否过期
    activated_at = models.DateTimeField(null=True)  #激活时间
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间
    remark = models.CharField(max_length=20, db_index=True)  #备注
    activated_to = models.CharField(max_length=20)  #申请人
    department = models.CharField(max_length=20)  #申请部门
    active_card_user_id = models.IntegerField(default=1)  #激活卡片人

    class Meta(object):
        db_table = 'market_tool_weizoom_card'
        verbose_name = '微众卡'
        verbose_name_plural = '微众卡'
示例#16
0
class TengyiMemberRebateCycle(models.Model):
    """
	腾易微众星级会员推荐返利周期
	"""
    member_id = models.IntegerField(default=0)
    start_time = models.DateTimeField()
    end_time = models.DateTimeField()
    is_receive_reward = models.BooleanField(default=False)  #是否已获得购物返利
    receive_reward_at = models.DateTimeField(
        default=DEFAULT_DATETIME)  #获得推荐返利时间
    is_recommend_member_receive_reward = models.BooleanField(
        default=False)  #是否被推荐人已获得推荐返利
    recommend_member_rebate_money = models.FloatField(default=0)  #推荐人返利金额
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta(object):
        db_table = 'tengyi_member_rebate_cycle'
示例#17
0
文件: models.py 项目: cash2one/gaia
class News(models.Model):
    material = models.ForeignKey(Material)  #素材外键
    display_index = models.IntegerField()  #显示顺序
    title = models.CharField(max_length=40)  #标题
    summary = models.CharField(max_length=120)  #摘要
    text = models.TextField(default='')  #正文
    pic_url = models.CharField(max_length=1024)  #图片url地址
    url = models.CharField(max_length=1024)  #目标地址
    link_target = models.CharField(max_length=2048)  #链接目标
    is_active = models.BooleanField(default=True)  #是否启用
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间
    is_show_cover_pic = models.BooleanField(default=True,
                                            verbose_name=u"是否在详情中显示封面图片")

    class Meta(object):
        db_table = 'material_news'
        verbose_name = '图文消息'
        verbose_name_plural = '图文消息'
示例#18
0
文件: models.py 项目: cash2one/gaia
class WeixinUser(models.Model):
    username = models.CharField(max_length=100, unique=True)
    webapp_id = models.CharField(max_length=16, verbose_name='对应的webapp id')
    fake_id = models.CharField(max_length=50, default="")  #微信公众平台字段fakeId
    nick_name = models.CharField(max_length=256)  #微信公众平台字段nickName
    weixin_user_remark_name = models.CharField(
        max_length=64)  #微信公众平台字段remarkName,暂未使用
    weixin_user_icon = models.CharField(max_length=1024)  #微信公众平台字段icon
    created_at = models.DateTimeField(auto_now_add=True)
    is_head_image_received = models.BooleanField(default=False)  #是否接收到头像
    head_image_retry_count = models.IntegerField(default=0)  #接收头像的重试次数
    is_subscribed = models.BooleanField(default=True)  #是否关注  0 :取消关注 ,1 :关注

    class Meta(object):
        managed = False
        ordering = ['-id']
        db_table = 'app_weixin_user'
        verbose_name = '微信用户'
        verbose_name_plural = '微信用户'
示例#19
0
文件: models.py 项目: cash2one/gaia
class WeixinMpUser(models.Model):
    """
    微信公众账号
    """
    owner = models.ForeignKey(User, unique=True)
    username = models.CharField(default='', max_length=50)  #用户名
    password = models.CharField(default='', max_length=50)  #密码
    is_certified = models.BooleanField(default=False, verbose_name='是否进行过微信认证')
    is_service = models.BooleanField(default=False, verbose_name='是否为服务号')
    is_active = models.BooleanField(default=True)  #公众号是否有效
    aeskey = models.IntegerField(default=AESKEY_NORMAL)
    encode_aeskey = models.TextField(default='')
    created_at = models.DateTimeField(auto_now=True)  #公众号添加的时间

    def __unicode__(self):
        return self.username

    class Meta(object):
        db_table = 'account_weixin_mp_user'
示例#20
0
class PageVisitLog(models.Model):
    webapp_id = models.CharField(max_length=16)
    token = models.CharField(max_length=64, blank=True)
    url = models.CharField(max_length=1024)
    is_from_mobile_phone = models.BooleanField()
    create_date = models.DateField(auto_now_add=True) #访问日期
    created_at = models.DateTimeField(auto_now_add=True) #访问时间

    class Meta(object):
        db_table = 'webapp_page_visit_log'
示例#21
0
class UserOrderNotifySettings(models.Model):
    user = models.ForeignKey(User)
    emails = models.TextField(default='')  # '|'分割
    black_member_ids = models.TextField(default='')  # '|'分割,会员id
    status = models.IntegerField(default=0)
    is_active = models.BooleanField(default=False)
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta(object):
        db_table = 'user_order_notify_setting'
示例#22
0
class MemberFollowRelation(models.Model):
    """
	会员关注关系
	"""
    member_id = models.IntegerField()
    follower_member_id = models.IntegerField()
    is_fans = models.BooleanField()  #是否是member_id 粉丝
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta(object):
        db_table = 'member_follow_relation'
示例#23
0
class AccountHasWeizoomCardPermissions(models.Model):
    """
	账号对应使用微众卡功能权限
	"""
    owner_id = models.IntegerField(default=0, verbose_name='账号id')
    is_can_use_weizoom_card = models.BooleanField(default=False,
                                                  verbose_name='是否可以使用微众卡')
    created_at = models.DateTimeField(auto_now_add=True, verbose_name='添加时间')

    class Meta(object):
        db_table = 'market_tool_weizoom_card_account_has_permissions'
示例#24
0
class ForbiddenCouponProduct(models.Model):
    owner = models.ForeignKey(User)
    product = models.ForeignKey(mall_models.Product)
    status = models.IntegerField(default=FORBIDDEN_STATUS_NOT_START)  #促销状态
    start_date = models.DateTimeField()  #开始日期
    end_date = models.DateTimeField()  #结束日期
    is_permanant_active = models.BooleanField(default=False)  #永久有效
    created_at = models.DateTimeField(auto_now_add=True)  #添加时间

    class Meta(object):
        db_table = 'mall_forbidden_coupon_product'
示例#25
0
文件: models.py 项目: cash2one/gaia
class GaiaApp(models.Model):
    """
	【Gaia用】GaiaApp
	"""
    name = models.CharField(max_length=20, db_index=True)
    app_key = models.CharField(max_length=50, unique=True)
    app_secret = models.CharField(max_length=50)
    is_deleted = models.BooleanField(default=False)

    class Meta(object):
        db_table = "gaia_app"
示例#26
0
文件: models.py 项目: cash2one/gaia
class Material(models.Model):
    owner = models.ForeignKey(User, related_name='owned_materials')
    type = models.IntegerField(default=SINGLE_NEWS_TYPE,
                               choices=MATERIAL_TYPES)
    created_at = models.DateTimeField(auto_now_add=True)
    is_deleted = models.BooleanField(default=False)  #是否删除

    class Meta(object):
        db_table = 'material_material'
        verbose_name = '素材'
        verbose_name_plural = '素材'
示例#27
0
class AccessToken(models.Model):
    app = models.ForeignKey(App)
    access_token = models.CharField(max_length=256)
    expires_in = models.CharField(max_length=100, verbose_name='expires_in')
    is_active = models.BooleanField(default=False)

    created_at = models.DateTimeField(auto_now_add=True)

    class Meta:
        db_table = 'access_token'
        verbose_name = 'access_token'
        verbose_name_plural = 'access_token'
示例#28
0
class PremiumSale(models.Model):
    """
	买赠
	"""
    owner = models.ForeignKey(User)
    count = models.IntegerField(default=0)  #购买基数
    is_enable_cycle_mode = models.BooleanField(default=False)  #循环买赠

    class Meta(object):
        db_table = 'mallpromotion_premium_sale'
        verbose_name = '买赠'
        verbose_name_plural = '买赠'
示例#29
0
class VirtualProduct(models.Model):
    """
	福利卡券活动
	"""
    owner = models.ForeignKey(User)
    name = models.CharField(max_length=128)  #活动名称
    product = models.ForeignKey(mall_models.Product)  #活动关联的商品
    is_finished = models.BooleanField(default=False)  #活动是否结束
    created_at = models.DateTimeField(auto_now_add=True)  #创建时间

    class Meta(object):
        db_table = 'mallpromotion_virtual_product'
示例#30
0
文件: models.py 项目: cash2one/gaia
class MemberGrade(models.Model):
    """
    会员等级
    """
    webapp_id = models.CharField(max_length=16, verbose_name='所关联的app id')
    name = models.TextField()
    is_auto_upgrade = models.BooleanField(default=False, verbose_name='是否凭经验值自动升级')
    upgrade_lower_bound = models.IntegerField(default=0, verbose_name='该等级的经验值下限')
    shop_discount = models.IntegerField(default=100, verbose_name='购物折扣')
    is_default_grade = models.BooleanField(default=False)
    usable_integral_percentage_in_order = models.IntegerField(verbose_name='一笔交易中能使用的多少积分', default=100) # -1 无限制
    pay_money = models.FloatField(default=0.00)
    pay_times = models.IntegerField(default=0)
    integral = models.IntegerField(default=0)
    created_at = models.DateTimeField(auto_now_add=True)

    class Meta(object):
        db_table = 'member_grade'

    def __unicode__(self):
        return u"{}-{}".format(self.webapp_id, self.name)