shiroyuki / Tori

Tornado-based Micro Web Framework
MIT License
3 stars 1 forks source link

Implement the data-object mapper for MongoDB #7

Closed shiroyuki closed 12 years ago

shiroyuki commented 12 years ago

Implement the data-object mapper which converts a corresponding MongoDB document to an object (standard object) and vise versa

from tori.db.entity import entity

@entity
class Profile(object):
    def __init__(self, name, age):
        self.name = name
        self.age  = age