ShortUUIDField

CharField

  • Installation

    pip install shortuuid
    
  • default=shortuuid.uuid

    import shortuuid
    
    uid = models.CharField(_(u'uid'), max_length=255, default=shortuuid.uuid, help_text=u'User UUID', db_index=True)
    
    • Since Django 1.7, Core Django support Migrations
    • And above will be ValueError: Cannot serialize:
    • Detail See Migrations

UUIDField

New In Django 1.8

ShortUUIDField

  • Installation

    pip install django-shortuuidfield
    
  • Usage

    from shortuuidfield import ShortUUIDField
    
    uid = ShortUUIDField(_(u'uid'), max_length=255, help_text=u'User UUID', db_index=True)
    

References

[1] [email protected], shortuuid — A generator library for concise, unambiguous and URL-safe UUIDs

[2] [email protected], django-shortuuidfield — Short UUID field for django

results matching ""

    No results matching ""