Created
May 31, 2011 22:27
-
-
Save thefekete/1001418 to your computer and use it in GitHub Desktop.
Abstract Model Class for single field ('name') models
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
class NameModel(models.Model): | |
""" | |
Abstract Model Class for single field ('name') models | |
""" | |
name = models.CharField(max_length=64, unique=True) | |
class Meta: | |
abstract = True | |
ordering = ['name'] | |
def __unicode__(self): | |
return unicode(self.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment