Created
March 2, 2011 22:38
-
-
Save byroot/851918 to your computer and use it in GitHub Desktop.
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
# -*- coding: utf-8 -*- | |
class Profile(models.Model): | |
foo = models.CharField() | |
user = models.ForeignKey(User) | |
@property | |
def first_name(self): | |
return self.user.first_name | |
@first_name.setter | |
def first_name(self, value): | |
self.user.first_name = value | |
def save(self, *args, **kwargs): | |
self.user.save() | |
super(Profile, self).save(*args, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment