-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMueble.py
More file actions
58 lines (46 loc) · 1.34 KB
/
Mueble.py
File metadata and controls
58 lines (46 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import gettext_lazy as _
class Mueble(models.Model):
class Meta:
verbose_name = _("Mueble")
verbose_name_plural = _('Muebles')
app_label = 'LabModule'
nombre = models.CharField(
max_length = 100,
default = '',
verbose_name = _("Nombre"),
null = False
)
descripcion = models.CharField(
max_length = 1000,
default = '',
verbose_name = _("Descripción"),
null = True
)
estado = models.BooleanField(
default = True,
verbose_name = _('Activa'),
null = False
)
imagen = models.ImageField(
upload_to = 'images',
verbose_name = _("Imagen"),
default = 'images/image-not-found.jpg'
)
tipo = models.CharField(
max_length = 1000,
default = 'Desconocido',
verbose_name = _("Descripción"),
null = False
)
def __unicode__(self):
return self.nombre
def get_nombre(self):
return self.nombre.capitalize()
def get_descripcion(self):
return self.descripcion.capitalize()
def get_estado(self):
return self.estado
def get_imagen(self):
return self.imagen