From a0d21e6435d488ca201607c6e1f4844ce70ed521 Mon Sep 17 00:00:00 2001 From: Brian Moe <lars@moe.phys.uwm.edu> Date: Tue, 10 Nov 2009 13:40:33 -0600 Subject: [PATCH] Initial stab at tagging events --- gracedb/models.py | 8 ++++++++ settings.py | 1 + settings_dev.py | 1 + 3 files changed, 10 insertions(+) diff --git a/gracedb/models.py b/gracedb/models.py index 89564d287..2babcd7cc 100644 --- a/gracedb/models.py +++ b/gracedb/models.py @@ -4,6 +4,9 @@ import thread import string import os +from tagging.fields import TagField +from tagging.models import Tag + from gracedb.ligolw.models import CoincEvent class User(models.Model): @@ -60,6 +63,11 @@ class Event(models.Model): # old date encoded uids. uid = models.CharField(max_length=20, unique=False, default="") + tags = TagField() + + def get_tags(self): + return Tag.objects.get_for_object(self) + class Meta: ordering = ["-id"] diff --git a/settings.py b/settings.py index 50f7bcd01..d5366dbe3 100644 --- a/settings.py +++ b/settings.py @@ -113,4 +113,5 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.sites', 'gracedb.gracedb', + 'tagging', ) diff --git a/settings_dev.py b/settings_dev.py index 3c03f0fe5..e64e2ecc1 100644 --- a/settings_dev.py +++ b/settings_dev.py @@ -105,4 +105,5 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.sites', 'gracedb.gracedb', + 'tagging', ) -- GitLab