Skip to content

Instantly share code, notes, and snippets.

@natea
Created June 7, 2011 21:45
Show Gist options
  • Save natea/1013249 to your computer and use it in GitHub Desktop.
Save natea/1013249 to your computer and use it in GitHub Desktop.
Valentunes Card class
class Card(models.Model):
""" Card is a valentine's day card that contains the information
about who the card is from and who it's to, what the recipients
interests are and a personal note.
"""
user = models.ForeignKey(User)
recipient_name = models.CharField(max_length=200, blank=True)
recipient_email = models.EmailField(max_length=200, null=True, blank=True)
recipient_phone = models.CharField(max_length=200, blank=True)
intro_note = models.TextField(max_length=1000, blank=True)
interests = models.TextField(max_length=1000, blank=True)
create_date = models.DateTimeField(auto_now_add=True)
def __unicode__(self):
return u"%s"%("Card"+str(self.id)+" from " + self.user.first_name + \
" to " + self.recipient_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment