from django.db import models
from django.contrib.auth.models import User

# Create your models here.


class Tag(models.Model):
	"""docstring for Tag"""
	nombre = models.CharField(max_length=50)
	def __unicode__(self):  # Python 3: def __str__(self):
		return self.nombre
class Categoria(models.Model):
	nombre = models.CharField(max_length=100)
	def __unicode__(self):
		return self.nombre

class Articulo(models.Model):
	"""docstring for Articulo"""
	titulo = models.CharField(max_length=200)
	fec_pub = models.DateField('Fecha de Publicado')
	Contenido = models.TextField()
	Contenido2 = models.TextField('Contenido Adicional', null=True)
	usuario = models.ForeignKey(User)
	visitas = models.IntegerField()
	tag = models.ManyToManyField(Tag)
	categoria = models.ManyToManyField(Categoria)
	def __unicode__(self):  # Python 3: def __str__(self):
		return self.titulo




		


		
