models.py 571 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
from django.db import models


class Contact(models.Model):
    """Contact model. Person to be called by users"""
    id = models.AutoField(primary_key=True)
    first_name = models.CharField(max_length=64)
    last_name = models.CharField(max_length=64)
    phone = models.CharField(max_length=32)
    twitter = models.CharField(max_length=64, blank=True)
    mail = models.CharField(max_length=255, blank=True)
12
    photo = models.ImageField(upload_to='contacts/photos', blank=True)
13 14 15

    def __unicode__(self):
        return '%s %s' % (self.first_name, self.last_name)