(cls, app, type)
return [app.materials.create_material(type=type, **item)
                for item in updates]
同步某种类型的永久素材
同步某种类型的永久素材
同步某种类型的永久素材
def sync_type(cls, app, type):
        """同步某种类型的永久素材"""
        updates = app.get_materials(type)
        # 删除被删除的 更新或新增获取的
        (app.materials.filter(type=type)
            .exclude(media_id__in=map(lambda o: o["media_id"], updates))
            .delete())
        return [app.materials.create_material(type=type, **item)
                for item in updates]
def sync_type ( cls , app , type ) : updates = app . get_materials ( type ) # 删除被删除的 更新或新增获取的 ( app . materials . filter ( type = type ) . exclude ( media_id__in = map ( lambda o : o [ "media_id" ] , updates ) ) . delete ( ) ) return [ app . materials . create_material ( type = type , * * item ) for item in updates ]