Skip to content

Instantly share code, notes, and snippets.

@thefekete
Created May 31, 2011 22:27
Show Gist options
  • Save thefekete/1001418 to your computer and use it in GitHub Desktop.
Save thefekete/1001418 to your computer and use it in GitHub Desktop.
Abstract Model Class for single field ('name') models
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