Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c3e5ea7855
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (19 sloc) 0.596 kb
import datetime
from mongolite import Connection, Document
connection = Connection()
@connection.register
class User(Document):
__collection__ = 'users'
skeleton = {
'username': unicode,
'access_token': dict,
'modify_date': datetime.datetime
}
optional = {
'user_id': int,
}
default_values = {'modify_date':datetime.datetime.utcnow}
def save(self, *args, **kwargs):
if '_id' in self and kwargs.get('update_modify_date', True):
self.modify_date = datetime.datetime.utcnow()
super(User, self).save(*args, **kwargs)
Jump to Line
Something went wrong with that request. Please try again.