Routeur: Ajout temporaire des modules workflow et dae en écriture
[auf_rh_dae.git] / src / qbe / django_qbe / models.py
CommitLineData
5cf90361
PP
1import pickle
2from django.contrib.auth.models import User
3from django.db import models
4from django.utils.translation import ugettext_lazy as _
5from picklefield.fields import PickledObjectField
6
7class SavedQuery(models.Model):
8 name = models.CharField(_("name"), max_length=100)
9 description = models.TextField(_("description"), blank=True)
10 query_data = PickledObjectField(protocol=pickle.HIGHEST_PROTOCOL)
11 date_created = models.DateTimeField(_("date created"), auto_now_add=True)
12 date_updated = models.DateTimeField(_("date updated"), auto_now=True)
13 user_created = models.ForeignKey(User, blank=False, related_name="savedquery_creator")
14 user_updated = models.ForeignKey(User, blank=False, related_name="savedquery_updator")
15
16 class Meta:
17 verbose_name = _("Saved query")
18 verbose_name_plural = _("Saved queries")
19
20 def __unicode__(self):
21 return self.name