diff options
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 19 | 
1 files changed, 19 insertions, 0 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index d65c08f93..016883abe 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1110,6 +1110,8 @@ class FullSearch(models.Model):          :param save: True if you want to save the object immediately          :return: True if modified          """ +        if not hasattr(self, 'search_vector'): +            return          if not self.pk:              logger.warning("Cannot update search vector before save or "                             "after deletion.") @@ -1555,6 +1557,23 @@ def post_delete_record_relation(sender, instance, **kwargs):          q.delete() +class SearchQuery(models.Model): +    label = models.TextField(_(u"Label"), blank=True) +    query = models.TextField(_(u"Query"), blank=True) +    content_type = models.ForeignKey(ContentType, +                                     verbose_name=_(u"Content type")) +    profile = models.ForeignKey("UserProfile", verbose_name=_(u"Profile")) +    is_alert = models.BooleanField(_(u"Is an alert"), default=False) + +    class Meta: +        verbose_name = _(u"Search query") +        verbose_name_plural = _(u"Search queries") +        ordering = ['label'] + +    def __unicode__(self): +        return unicode(self.label) + +  class ShortMenuItem(object):      @classmethod      def get_short_menu_class(cls, pk): | 
