Example #1
0
def create_documents():
    output = []
    for x in range(0, 5):
        mopDocument = MopDocument.objects.all().order_by('?')[0]
        randomizedDocument = randomize_document(mopDocument)
        output.append(randomizedDocument.serial)
    return output
Example #2
0
def create_single_document(mopDocument):
    randomizedDocument = randomize_document(mopDocument)
    randomizedDocument.appearAt = now()
    randomizedDocument.dueAt = now() + timedelta(days=1)
    randomizedDocument.save()
    return randomizedDocument.serial