Created
January 27, 2015 19:55
-
-
Save lov3catch/a6115700c7addcaf356f to your computer and use it in GitHub Desktop.
ObjectId to DateTime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start_date = DateTimeField(default=datetime.datetime.now) | |
# http://api.mongodb.org/python/current/api/bson/objectid.html | |
orders = Order.objects() | |
for order in orders: | |
print 'generation: ',order.id.generation_time | |
print 'create: ',order.date | |
# order.date = order.id.generation_time | |
# order.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment