From c4c2c640cece3983e95b6ef8ce7a25ef68d4e9a3 Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 9 Aug 2012 04:34:54 +0530 Subject: [PATCH] get_dict methods --- itf/offersneeds/models.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/itf/offersneeds/models.py b/itf/offersneeds/models.py index 8dcb8a2..e70a885 100644 --- a/itf/offersneeds/models.py +++ b/itf/offersneeds/models.py @@ -6,6 +6,7 @@ from django.contrib.auth.models import User class Offer(ItfModel): form_names = ['OfferForm'] main_form = 'OfferForm' + fts_fields = ['title', 'description'] user = models.ForeignKey(User) title = models.CharField(max_length=255) description = models.TextField(blank=True) @@ -13,10 +14,17 @@ class Offer(ItfModel): def __unicode__(self): return self.title + def get_dict(self): + return { + 'title': self.title, + 'description': self.description + } + class Need(ItfModel): form_names = ['NeedForm'] main_form = 'NeedForm' + fts_fields = ['title', 'description'] user = models.ForeignKey(User) title = models.CharField(max_length=255) description = models.TextField(blank=True) @@ -24,6 +32,11 @@ class Need(ItfModel): def __unicode__(self): return self.title + def get_dict(self): + return { + 'title': self.title, + 'description': self.description + } # Create your models here.