-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
20 lines (17 loc) · 852 Bytes
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from django.db import models
from core.models import Technology
# Create your models here.
class Project(models.Model):
title = models.CharField(max_length=200, verbose_name="Título")
description = models.TextField(verbose_name="Descripción")
image = models.ImageField(verbose_name="Imagen", upload_to="projects")
url = models.URLField(max_length=200, verbose_name="URL del Proyecto", default="#")
technologies = models.ManyToManyField(Technology, verbose_name="Technologies")
created = models.DateTimeField(auto_now_add=True, verbose_name="Fecha de creación")
updated = models.DateTimeField(auto_now=True, verbose_name="Fecha de edición")
class Meta:
verbose_name = "proyecto"
verbose_name_plural = "proyectos"
ordering = ["-created"]
def __str__(self):
return self.title