Created
January 7, 2014 10:01
-
-
Save camilosanchez/8297214 to your computer and use it in GitHub Desktop.
model for my app
This file contains 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
from django.db import models | |
from django.contrib.auth.models import User | |
# Create your models here. | |
class Offer(models.Model): | |
offer_owner = models.ForeignKey(User, related_name="offers") | |
created_at = models.DateTimeField(auto_now_add=True, editable=False) | |
updated_at = models.DateTimeField(auto_now=True, editable=False) | |
business_name = models.CharField(max_length=255, verbose_name="nombre de la empresa") | |
offer_title = models.CharField(max_length=255, verbose_name="titulo de la oferta") | |
offer_date_from = models.DateTimeField(null=True, blank=False, editable=True, auto_now_add=False, verbose_name="fecha en que inicia la oferta") | |
offer_date_to = models.DateTimeField(null=True, blank=False, editable=True, auto_now_add=False, verbose_name="fecha en que finaliza la oferta") | |
offer_detail = models.TextField(verbose_name="detalles de la oferta") | |
offer_terms = models.TextField(verbose_name="terminos de la oferta") | |
published = models.BooleanField(default=True, verbose_name="esta oferta esta publica") | |
from_fanpage = models.CharField(max_length=255, verbose_name="nombre del fanpage") #fanpage info | |
fanpage_id = models.BigIntegerField(verbose_name="fanpage id") | |
fanpage_url = models.URLField(verbose_name="fanpage url") | |
def __unicode__(self): | |
return self.offer_title | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment