Exemplo n.º 1
0
 def update_from_json(self, arr):
     self.nick = require_value_from_dict(arr, "nick")
     self.password = require_value_from_dict(arr, "password")
     self.name = require_value_from_dict(arr, "name")
     self.mobile = require_value_from_dict(arr, "mobile")
     self.email = require_value_from_dict(arr, "email")
     self.status = 0
Exemplo n.º 2
0
 def __init__(self, arr, qq):
     self.external_id = require_value_from_dict(arr, 'external_id')
     self.robots = []
     # self.robot1_id = require_value_from_dict('robots_id')
     # self.robot2_id = require_value_from_dict('robots_id')
     self.name = require_value_from_dict('name')
     self.creator_qq = qq
     self.members = []
     # self.events = []
     self.status = 0
Exemplo n.º 3
0
 def __init__(self, arr, user_id):
     self.creator_id = user_id
     self.name = require_value_from_dict(arr, "name")
     self.area = require_value_from_dict(arr, "area")
     self.address = require_value_from_dict(arr, "address")
     self.city = get_value_from_dict(arr, "city", "北京")
     self.lat = require_value_from_dict(arr, "lat")
     self.lng = require_value_from_dict(arr, "lng")
     self.phone = get_value_from_dict(arr, "phone", "")
     self.way = get_value_from_dict(arr, "way", "")
Exemplo n.º 4
0
 def __init__(self, user_arr, user_id):
     self.id = user_id
     self.mobile = require_value_from_dict(user_arr, "mobile")
     self.name = require_value_from_dict(user_arr, "name")
     self.sex = require_value_from_dict(user_arr, "sex")
     self.birthday = get_value_from_dict(user_arr, "birthday", None)
     self.city = get_value_from_dict(user_arr, "city", None)
     self.head_img_url = get_value_from_dict(user_arr, "head_img_url", None)
     self.password = ''
     self.clubs = []
     self.clusters = []
     self.devices = []
     self.messages = []
     self.wechat = {}
     self.create_time = int(time.time())
Exemplo n.º 5
0
    def __init__(self, arr, user_id, is_update=False):
        if not is_update:
            self.id = int(require_value_from_dict(arr, "id"))  # 数字id,为关系型数据库
            self.club_id = int(require_value_from_dict(arr, "club_id"))

            self.status = 0
            self.creator_id = user_id
            self.create_time = int(time.time())
            self.members_count = 0
            self.members_count_limit = int(get_value_from_dict(arr, "members_count_limit", 0))
            self.members = []  # 开始为空,创建者不一定是参加者
            self.type = "event"
        # 以下信息可修改
        self.name = require_value_from_dict(arr, "name")
        # 默认开放
        self.category = get_value_from_dict(arr, "category", u"足球")
        self.is_cycle = get_value_from_dict(arr, "is_cycle", "false")
        self.start_time = int(require_value_from_dict(arr, "start_time"))
        self.end_time = int(require_value_from_dict(arr, "end_time"))
        self.weekday = date.weekday(date.fromtimestamp(float(self.start_time)))
        if self.is_cycle == "true" and get_value_from_dict(arr, "days", False):
            self.days = []
            days = get_value_from_dict(arr, "days", "").split(',')
            for day in days:
                self.days.append(int(day))
        # 场馆信息
        self.venue = {
            "title": get_value_from_dict(arr, "venue_title", ""),
            "address": get_value_from_dict(arr, "venue_address", ""),
            "phone": get_value_from_dict(arr, "venue_phone", ""),
            "city": get_value_from_dict(arr, "venue_city", ""),
            "coordinate": [
                get_value_from_dict(arr, "venue_lng", 0),
                get_value_from_dict(arr, "venue_lat", 0)
            ]
        }
        self.fee = int(get_value_from_dict(arr, "fee", 0))
        self.is_aa = get_value_from_dict(arr, "is_aa", "true")
        self.place_num = get_value_from_dict(arr, "place_num", "")
        self.mobile = get_value_from_dict(arr, "mobile", 0)
        self.members_count_limit = int(get_value_from_dict(arr, "members_count_limit", 0))
        if arr.get("clusters"):
            self.clusters = arr.get("clusters").split(',')
        else:
            self.clusters = []
        self.introduce = get_value_from_dict(arr, "introduce", "")
Exemplo n.º 6
0
 def process_item(self, item, spider):
     i = CompanyInfoItem()
     for key in [
             'province', 'phone', 'email', 'company_name',
             'registration_number', 'organization_registration_code',
             'business_status', 'business_type', 'register_date',
             'legal_representative', 'registered_capital',
             'operating_period', 'registration_authority', 'date_of_issue',
             'business_address', 'business_scope',
             'unified_social_credit_code', 'english_name', 'item_category',
             'item_category_num', 'item_from'
     ]:
         i[key] = require_value_from_dict(item, key)
     return i
Exemplo n.º 7
0
 def update_from_json(self, arr):
     self.record_user_id = require_value_from_dict(arr, "record_user_id")
     self.spend_user_id = require_value_from_dict(arr, "spend_user_id")
     self.type_id = require_value_from_dict(arr, "type_id")
     self.desc = require_value_from_dict(arr, "desc")
     self.money = require_value_from_dict(arr, 'money')
     self.date = require_value_from_dict(arr, "date")
     self.status = 0
     pass
Exemplo n.º 8
0
    def __init__(self, club_arr, user_id):
        # self.id = int(require_value_from_dict(club_arr, "id"))  # 数字id,为关系型数据库
        self.name = require_value_from_dict(club_arr, "name")
        self.logo_url = get_value_from_dict(club_arr, "logo_url", "")
        self.bg_img_url = get_value_from_dict(club_arr, "bg_img_url", "")
        self.tags = get_value_from_dict(club_arr, "tags", "足球")
        # self.city = get_value_from_dict(club_arr, "city", "")
        self.bind_qq = get_value_from_dict(club_arr, "bind_qq", "")
        # 俱乐部创建者
        self.creator_id = user_id
        self.create_time = int(time.time())

        self.status = 0

        self.members_count = 1
        self.members = [{"id": user_id, "role": 0, "join_time": int(time.time())}]  # 俱乐部创始人

        self.events_count = 0
        self.follow_members_count = 0
Exemplo n.º 9
0
 def __init__(self, arr):
     self.id = int(require_value_from_dict(arr, 'id'))
     self.username = require_value_from_dict(arr, 'username')
     self.password = require_value_from_dict(arr, 'password')
     self.club_id_list = []
Exemplo n.º 10
0
 def __init__(self, arr):
     self.pin_yin = require_value_from_dict(arr, 'pin_yin')
     self.code = require_value_from_dict(arr, 'cdoe')
     self.name = require_value_from_dict(arr, 'name')
Exemplo n.º 11
0
 def __init__(self, arr, qq):
     self.qq = qq
     self.user_id = require_value_from_dict(arr, 'user_id')
     self.code = require_value_from_dict(arr, 'code')  # "YD99"
     self.create_time = require_value_from_dict(arr, 'create_time')
Exemplo n.º 12
0
 def update_from_json(self, arr):
     self.name = require_value_from_dict(arr, "name")
     self.status = 0
     pass