Skip to content

Instantly share code, notes, and snippets.

View lucasvo's full-sized avatar

Lucas Vogelsang lucasvo

View GitHub Profile
@anemitz
anemitz / gist:3447356
Created August 24, 2012 08:09
MongoEngine RandomPKDocument
import os
from zbase62 import zbase62
from mongoengine import *
from mongoengine.queryset import OperationError
class RandomPKDocument(Document):
id = StringField(unique=True, primary_key=True)
def get_pk_prefix(self):