using yaml for persistence

1 view
Skip to first unread message

paul jobs

unread,
Mar 2, 2009, 9:18:01 PM3/2/09
to sch...@googlegroups.com
class User(object):
    def __init__(self, uid):
       self.uid = uid
       self.__dict__.update(yaml.load(str('uid')+'.yaml'))
 
    def save(self):
        f=open(str(self.uid)+'.yaml')
        yaml.dump(self.__dict__, f)
 
 
 
is there a better way to persist using Yaml
Reply all
Reply to author
Forward
0 new messages