跳转到主要内容

Django中的UUIDField

项目描述

为您的Django模型提供UUIDField。

安装

使用pip(或easy_install)安装

pip install django-uuidfield

使用方法

首先,您需要将一个UUIDField附加到您的类上。这作为char(32)使用,以保持与SQL版本的兼容性

from uuidfield import UUIDField

class MyModel(models.Model):
    uuid = UUIDField(auto=True)

查看源代码以获取更多配置值。

祝您玩得开心!

由以下赞助

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面