Exemplo n.º 1
0
class Recipe_Ingredients(models.Model):
    recipe_ingredients_id = models.Autofield(primary_key=True)
    recipe_id = models.ForeignKey(Recipes, on_delete=models.CASCADE)
    ingredient_id = models.ForeignKey(
        Ingredients, on_delete=models.CASCADE)  # no many:many b/c new table
    quantity = models.CharField("Ingredient quantity", max_length=10)
    date_created = models.DateTimeField("Date created")
Exemplo n.º 2
0
class Recipes(models.Model):
    recipe_id = models.Autofield(primary_key=True)
    recipe_name = models.CharField("Recipe name", max_length=200)
    recipe_source = models.CharField("Recipe source", max_length=200)
    recipe_type = models.CharField(max_length=30)
    user_id = models.ForeignKey(Users, on_delete=models.CASCADE)
    date_created = models.DateTimeField("Date created")
Exemplo n.º 3
0
class Asistente(models.Model):
    id = models.Autofield(primary_key=True)
    nombre = models.CharField(max_length=50)
    posada = models.ForeignKey(Posada,
                               on_delete=models.CASCADE,
                               related_name="asistentes")
    insumo = models.CharField(max_length=50, choices=INSUMOS)
Exemplo n.º 4
0
class Menu(models.Model):
    meal_id = models.Autofield(primary_key=True)
    meal = models.CharField(max_length=50, unique=True)
    vegetarian = models.BooleanField(default=False)
    price = models.DecimalField(max_digits=6, decimal_places=2)
    kitchen = models.ForeignKey(Kitchen, on_delete=models.CASCADE)

    def __str__(self):
        return (self.meal)
Exemplo n.º 5
0
class cust_payments_methods(models.Model):
    cust_payment_id = models.Autofield(primary_key=True)
    customer = models.ForeignKey(Customers, on_delete=models.CASCADE)
    payment_method_code = models.ForeignKey(ref_payment_methods,
                                            on_delete=models.CASCADE)
    card_number = models.CharField(max_length=24)
    name_on_card = models.CharField(max_length=256)
    expiry_date = models.DateField(auto_now=False)
    other_details = models.CharField(max_length=256)
Exemplo n.º 6
0
class Pais(models.Model):
    id_pais = models.Autofield(primary_key=True)
    nombre_pais = models.CharField(max_lenght=45)

    def __str__(self):
        return self.nombre_pais

    class Meta:
        ordering = ['nombre_pais']
        verbose_name = ['Pais']
        db_table = 'pais'
        verbose_name_plural = "Paises"
Exemplo n.º 7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Banner",
            fields=[
                (
                    "id",
                    models.Autofield(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "title",
                    models.CharField(
                        help_text="Text to display in the banner's buttton",
                        max_length=1024,
                    ),
                ),
                (
                    "message",
                    models.CharField(
                        help_text="Message to display in the banner",
                        max_length=2048),
                ),
                (
                    "link",
                    models.CharField(help_text="Link the button will go to",
                                     max_length=1024),
                ),
                (
                    "active",
                    models.BooleanField(
                        default=False,
                        help_text="Make the banner active on the site"),
                ),
                (
                    "psf_pages_only",
                    models.BooleanField(
                        default=True,
                        help_text="Display the bannr on/psf pages only"),
                ),
            ],
        )
    ]
Exemplo n.º 8
0
class Servicio(models.Model):
    id_servicio = models.Autofield(primary_key=True)
    nombre_servicio = models.CharField(max_lenght=45)
    precio = models.DecimalField(max_digits=None, decimal_places=None)

    def __str__(self):
        return self.nombre_servicio

    class Meta:
        ordering = ['nombre_servicio']
        verbose_name = ['Servicio']
        db_table = 'servicio'
        verbose_name_plural = "Servicios"
Exemplo n.º 9
0
class Kitchen(models.Model):

    kitchen_id = models.Autofield(primary_key=True)
    kitchen_pic = models.ImageField(upload_to='uploads/%Y/%m/%d/')
    provider = models.ForeignKey(Provider, on_delete=models.CASCADE)

    Mon = models.BooleanField(default=False)
    Tue = models.BooleanField(default=False)
    Wed = models.BooleanField(default=False)
    Thu = models.BooleanField(default=False)
    Fri = models.BooleanField(default=False)
    Sat = models.BooleanField(default=False)
    Sun = models.BooleanField(default=False)

    start_time_choices = (
        (6, '6 AM'),
        (7, '7 AM'),
        (8, '8 AM'),
        (9, '9 AM'),
        (10, '10 AM'),
        (11, '11 AM'),
        (12, '12 PM'),
        (13, '1 PM'),
        (14, '2 PM'),
        (15, '3 PM'),
        (16, '4 PM'),
        (17, '5 PM'),
        (18, '6 PM'),
    )
    start_time = models.PositiveSmallIntegerField(choices=start_time_choices,
                                                  default=9)

    end_time_choices = (
        (11, '11 AM'),
        (12, '12 PM'),
        (13, '1 PM'),
        (14, '2 PM'),
        (15, '3 PM'),
        (16, '4 PM'),
        (17, '5 PM'),
        (18, '6 PM'),
        (19, '7 PM'),
        (20, '8 PM'),
        (21, '9 PM'),
        (22, '10 PM'),
        (23, '11 PM'),
    )
    end_time = models.PositiveSmallIntegerField(choices=end_time_choices,
                                                default=17)
Exemplo n.º 10
0
class Estado(models.Model):
    id_estado = models.Autofield(primary_key=True)
    nombre_estado = models.CharField(max_lenght=100)
    pais = models.ForeignKey('Pais',
                             models.DO_NOTHING,
                             db_column='id_pais',
                             blank=True,
                             null=True,
                             verbose_name="Pais")

    def __str__(self):
        return self.nombre_estado

    class Meta:
        ordering = ['nombre_estado']
        verbose_name = ['Estado']
        db_table = 'estado'
        verbose_name_plural = "Estados"
Exemplo n.º 11
0
class CalleAvenida(models.Model):
    id_calle_avenida = models.Autofield(primary_key=True)
    nombre_calle_avenida = models.TextField()
    parroquia = models.ForeignKey('Parroquia',
                                  models.DO_NOTHING,
                                  db_column='id_parroquia',
                                  blank=True,
                                  null=True,
                                  verbose_name="Parroquia")

    def __str__(self):
        return self.nombre_calle_avenida

    class Meta:
        ordering = ['nombre_calle_avenida']
        verbose_name = ['Dirección: Calle y Avenida']
        db_table = 'calle_avenida'
        verbose_name_plural = "Dirección: Calles y Avenidas"
Exemplo n.º 12
0
class Parroquia(models.Model):
    id_parroquia = models.Autofield(primary_key=True)
    nombre_parroquia = models.CharField(max_lenght=45)
    municipio = models.ForeignKey('Municipio',
                                  models.DO_NOTHING,
                                  db_column='id_municipio',
                                  blank=True,
                                  null=True,
                                  verbose_name="Municipio")

    def __str__(self):
        return self.nombre_parroquia

    class Meta:
        ordering = ['nombre_parroquia']
        verbose_name = ['Parroquia']
        db_table = 'parroquia'
        verbose_name_plural = "Parroquias"
Exemplo n.º 13
0
class Municipio(models.Model):
    id_municipio = models.Autofield(primary_key=True)
    nombre_municipio = models.CharField(max_lenght=45)
    ciudad = models.ForeignKey('Ciudad',
                               models.DO_NOTHING,
                               db_column='id_ciudad',
                               blank=True,
                               null=True,
                               verbose_name="Ciudad")

    def __str__(self):
        return self.nombre_municipio

    class Meta:
        ordering = ['nombre_municipio']
        verbose_name = ['Municipio']
        db_table = 'municipio'
        verbose_name_plural = "Municipios"
Exemplo n.º 14
0
class Ciudad(models.Model):
    id_ciudad = models.Autofield(primary_key=True)
    nombre_ciudad = models.CharField(max_lenght=45)
    estado = models.ForeignKey('Estado',
                               models.DO_NOTHING,
                               db_column='id_estado',
                               blank=True,
                               null=True,
                               verbose_name="Estado")

    def __str__(self):
        return self.nombre_ciudad

    class Meta:
        ordering = ['nombre_ciudad']
        verbose_name = ['Ciudad']
        db_table = 'ciudad'
        verbose_name_plural = "Ciudades"
Exemplo n.º 15
0
class Hotel(models.Model):
    id_hotel = models.Autofield(primary_key=True)
    nombre_hotel = models.CharField(max_lenght=45)
    ubicacion = models.ForeignKey('CalleAvenida',
                                  models.DO_NOTHING,
                                  db_column='id_calle_avenida',
                                  blank=True,
                                  null=True,
                                  verbose_name="Dirección: Calle y Avenida")

    def __str__(self):
        return self.nombre_hotel

    class Meta:
        ordering = ['nombre_hotel']
        verbose_name = ['Hotel']
        db_table = 'hotel'
        verbose_name_plural = "Hoteles"
Exemplo n.º 16
0
class Ingredients(models.Model):
    ingredient_id = models.Autofield(primary_key=True)
    ingredient_name = models.CharField("Ingredient name", max_length=30)
    ingredient_type = models.CharField("Ingredient type", max_length=30)
    date_created = models.DateTimeField("Date created")
Exemplo n.º 17
0
class Users(models.Model):
    user_id = models.Autofield(primary_key=True)
    email = models.CharField("Email address", max_length=50)
    first_name = models.CharField("First name", max_length=30)
    last_name = models.CharField("Last name", max_length=30)
    date_created = models.DateTimeField("Date created")
Exemplo n.º 18
0
class Dish_Photos(models.Model):
    dish_photo_id = models.Autofield(primary_key=True)
    dish_id = models.ForeignKey(Dishes, on_delete=models.CASCADE)
    photo_source = models.CharField("Photo url", max_length=200)
    date_created = models.DateTimeField("Date created")
Exemplo n.º 19
0
class Recipe_Method(models.Model):
    recipe_method_id = models.Autofield(primary_key=True)
    recipe_id = models.ForeignKey(Recipes, on_delete=models.CASCADE)
    method_text = models.CharField("Recipe method", max_length=500)
    date_created = models.DateTimeField("Date created")
Exemplo n.º 20
0
class Dishes(models.Model):
    dish_id = models.Autofield(primary_key=True)
    recipe_id = models.ForeignKey(Recipes, on_delete=models.CASCADE)
    dish_details = models.CharField("Dish details", max_length=300)
    dish_rating = models.IntegerField(default=0)
    date_created = models.DateTimeField("Date created")