Skip to content

Instantly share code, notes, and snippets.

@byroot
Created March 2, 2011 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save byroot/851918 to your computer and use it in GitHub Desktop.
Save byroot/851918 to your computer and use it in GitHub Desktop.
# -*- 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