Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Group(models.Model):
- name = models.CharField(
- verbose_name=u'Group',
- null=False,
- default=u'Sample Group',
- max_length=64
- )
- def __unicode__(self):
- return '{0}'.format(self.name)
- class Meta(object):
- verbose_name = u'Group'
- verbose_name_plural = u'Groups'
- class Contact(models.Model):
- group = models.ForeignKey(
- Group,
- verbose_name=u'Group',
- )
- name = models.CharField(
- verbose_name=u'Contact name',
- null=False,
- default=u'Def contact',
- max_length=64
- )
- number = models.CharField(
- verbose_name=u'Number',
- max_length=20
- )
- created_at = models.DateTimeField(
- auto_now_add=True,
- editable=False,
- null=True,
- )
- modified_at = models.DateTimeField(
- auto_now=True,
- blank=True,
- null=True,
- )
- def __unicode__(self):
- return '{0} {1}'.format(self.name, self.number)
- class Meta(object):
- verbose_name = u'Contact'
- verbose_name_plural = u'Contacts'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement