from django.db import models
from django.utils import timezone

class Tag(models.Model):
    dummyname = models.CharField(max_length=127) # ALWAYS USE TRANSLATED NAME!!!

class TagTr(models.Model):
    '''
    Model containing translations for tags
    '''
    lang = models.CharField(max_length=2, default='fi')
    name = models.CharField(max_length=127)
    translation_for = models.ForeignKey('Tag', related_name='translations')

class Info(models.Model):
    '''
    model containing something showing on some info feed
    '''
    publish_time = models.DateTimeField(default=timezone.now)
    #published_by = models.Foreignkey(User) #<-- TODO create usermodel
    tags = models.ManyToManyField(Tag,related_name="news")

class InfoTr(models.Model):
    '''
    Model containing translations for news
    '''
    lang = models.CharField(max_length=2, default='fi')
    
    topic = models.CharField(max_length=255)
    content = models.TextField()
    translation_for = models.ForeignKey('Info', related_name='translations')

