ass=" item" href="/Kodo/kodo/pulls"> 合并请求 0 提交历史 371 版本发布 0

暂无描述

storage_utils.py 750B

    # -*- coding: utf-8 -*- import os import shortuuid from django.core.files.storage import default_storage from django.db import transaction from filemd5 import calculate_md5 from photo.models import PhotoUUIDInfo @transaction.atomic def file_save(file_, prefix='img', ext='jpeg'): ext = os.path.splitext(file_.name)[-1] or ext photo, created = PhotoUUIDInfo.objects.select_for_update().get_or_create(photo_md5=calculate_md5(file_)) if not photo.photo_path: path = '{}/{}{}'.format(prefix, shortuuid.uuid(), ext) if default_storage.exists(path): default_storage.delete(path) default_storage.save(path, file_) photo.photo_path = path photo.save() return photo.photo_path, ext
kodo - Gogs: Go Git Service

Няма описание

tests.py 126B

    # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase # Create your tests here.