Example #1
0
def get_all_notice():
    notice_db_path = os.path.join(settings.DB_PATH, 'notice')
    notice_file_list = common.get_all_file(notice_db_path)
    print(notice_file_list)
    notice_list = []
    for notice in notice_file_list:
        notice_list.append(dbhandler.select(notice, 'notice'))
    return notice_list
Example #2
0
def get_all_download_record():
    download_record_db_path = os.path.join(settings.DB_PATH, 'download_record')
    download_record_file_list = common.get_all_file(download_record_db_path)
    print(download_record_file_list)
    record_list = []
    for download_record in download_record_file_list:
        record_list.append(dbhandler.select(download_record,
                                            'download_record'))
    return record_list
Example #3
0
def get_all_movie():
    movie_db_path = os.path.join(settings.DB_PATH, 'movie')
    movie_file_list = common.get_all_file(movie_db_path)
    print(movie_file_list)
    movie_list = []
    # aa3 = dbhandler.select('aa3','movie')
    # print(aa3)
    for movie in movie_file_list:
        movie_list.append(dbhandler.select(movie, 'movie'))
    return movie_list


# if __name__ == '__main__':
#     get_all_movie()
Example #4
0
 def get_obj_by_name(cls, name):
     return dbhandler.select(name, cls.__name__.lower())
Example #5
0
        self.name = name
        self.path = path
        self.is_free = is_free
        self.is_delete = is_delete
        self.create_time = create_time
        self.user_id = user_id
        self.file_md5 = file_md5
        self.save()


class Download_record(BasicClass):
    def __init__(self, name, user_name, movie_name):
        self.name = name
        self.user_name = user_name
        self.movie_name = movie_name
        self.save()


if __name__ == '__main__':
    movie = modles.Movie(name='aa2',
                         path='11',
                         is_free=0,
                         is_delete=0,
                         create_time='2018-5-5',
                         user_id=1,
                         file_md5='aaa')
    print(movie.name)

    aa3 = dbhandler.select('aa3', 'movie')
    print(aa3)
Example #6
0
def delete_movie(user_dic, conn):
    movie = dbhandler.select(name=user_dic['movie_name'], type='movie')
    movie.is_delete = 1
    movie.save()
    back_dic = {'flag': True, 'msg': '删除成功!'}
    common.send_back(back_dic, conn)