代码拉取完成,页面将自动刷新
同步操作将从 cosven/FeelUOwn 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
# -*- coding=utf8 -*-
__author__ = 'cosven'
class DataModel(object):
def user(self):
user_model = {
'uid': int,
'username': unicode,
'avatar': unicode
}
return user_model
def music(self):
music_model = {
'id': int,
'name': unicode,
'artists': list,
'album': dict,
'duration': unicode,
'mp3Url': unicode
}
return music_model
def playlist(self):
playlist_model = {
'id': int,
'name': unicode
}
return playlist_model
def set_datamodel_from_data(self, data, datamodel):
"""
before generating model, the data should be validated
requirement: the datastructure of model is similar with standard
:param data: dict, input data
:param type: string, the target model type
"""
# temperarily: no validation check
for key in datamodel:
datamodel[key] = data[key]
return datamodel
def validate(self, data, model_type):
"""
compare data with the standard model, to validate the data basicllay.
1. check those keys which data must contain
:param data: dict type,
:param model: dict type, standard data model. base on the doc
:return: if validated: true
"""
return True
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。