Created
February 1, 2013 08:45
-
-
Save maiksprenger/4690160 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
class Partner(models.Model): | |
""" | |
New partner class. | |
Note: 'name' and 'users' are dropped from Oscar's partner model. | |
""" | |
user = models.OneToOneField('auth.User') | |
def __unicode__(self): | |
return u'%s: %s' % (_('Fulfillment Partner'), | |
self.user) | |
@property | |
def name(self): | |
""" | |
Duck-typing to not break Oscar. | |
""" | |
return unicode(self) | |
@property | |
def users(self): | |
""" | |
Duck-typing to not break Oscar. | |
""" | |
return [self.user,] | |
class Meta(AbstractPartner.Meta): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment