Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def __get__(self, obj, type=None):
- if obj is None:
- raise AttributeError('Can only be accessed via an instance.')
- if not obj.__dict__.has_key(self.field.name):
- # do lazy conversion now
- obj.__dict__[self.field.name] = self.field.to_python(obj.__dict__['_lazy_fields'][self.field.name])
- return obj.__dict__[self.field.name]
Add Comment
Please, Sign In to add comment