blob: 786b0362a727ad3b99f76cbdfdfa47486e0acafb [file] [log] [blame]
Siobhan Tullyde5450d2013-06-21 11:35:33 -04001import os
2from django.db import models
3from core.models import PlCoreBase
4from django.contrib.contenttypes.models import ContentType
5from django.contrib.contenttypes import generic
6
7# Create your models here.
8
9class Tag(PlCoreBase):
10
11 name = models.SlugField(help_text="The name of this tag", max_length=128)
12 value = models.CharField(help_text="The value of this tag", max_length=1024)
13
14 # The required fields to do a ObjectType lookup, and object_id assignment
15 content_type = models.ForeignKey(ContentType)
16 object_id = models.PositiveIntegerField()
17 content_object = generic.GenericForeignKey('content_type', 'object_id')
18
19 def __unicode__(self):
20 return self.name
21