Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # This code is under the MIT license. | |
| # Inspired by this StackOverflow question: | |
| http://stackoverflow.com/questions/3295405/creating-django-objects-with-a-random-primary-key | |
| import struct | |
| from Crypto.Cipher import DES | |
| from django.db import models | |
| def base36encode(number): |