Last active
August 23, 2019 09:44
-
-
Save bencleary/87c33623fa2f61e5e58b6e8f3b01b6aa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from .utils import CustomerTypes | |
class Customer(models.Model): | |
... | |
type = models.IntegerField(choices=CustomerTypes.choices(), default=CustomerTypes.PROSPECT) | |
... | |
def get_customer_type_label(self): | |
return CustomerTypes(self.type).name.title() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment