예제 #1
0
 def search_index(self):
     # Return a (key, url, order, display, name, body) tuple with text for indexing
     body = u'%s %s %s %s %s %s %s %s %s' % (
         self.name, self.address, self.address2, self.city, self.state,
         self.zipcode, self.phone, self.fax, self.parking_name)
     return SearchKey(self.pk, self.get_absolute_url(), self.order,
                      self.name, self.name, body)
예제 #2
0
파일: models.py 프로젝트: cash2one/smgsite
 def search_index(self):
     if self.posting_time >= datetime(2009, 1, 1):
         # Return a (key, url, order, display, name, body) tuple with text for indexing
         return SearchKey(self.article_id, self.get_absolute_url(),
                          self.posting_time.isoformat(), self.headline,
                          self.headline, self.body)
     return None
예제 #3
0
파일: models.py 프로젝트: cash2one/smgsite
 def search_index(self):
     # Return a (key, url, order, display, name, body) tuple with text for indexing
     body = "%s " % self.name()
     topbody = "%s " % self.name()
     body += "%s " % unicode(self.title_service)
     topbody += "%s " % unicode(self.title_service)
     for service in self.services.all():
         body += "%s " % unicode(service)
     for degree in self.degree_set.all():
         body += "%s %s " % (degree.letters.letters, degree.description)
     for accreditation in self.accreditation_set.all():
         body += "%s %s " % (accreditation.name.name,
                             accreditation.description)
     for specialty in self.specialties.all():
         body += "%s " % (specialty.specialty)
     body += "%s " % unicode(self.touch)
     if self.suffix:
         display = '<a href="%s">%s, %s %s, %s, <span class="doctor_cred">%s</span></a> - <span class="doctor_dept">%s</span>' % (
             self.get_absolute_url(), self.last_name, self.first_name,
             self.middle_name, self.suffix, self.letters,
             self.list_services())
     else:
         display = '<a href="%s">%s, %s %s, <span class="doctor_cred">%s</span></a> - <span class="doctor_dept">%s</span>' % (
             self.get_absolute_url(), self.last_name, self.first_name,
             self.middle_name, self.letters, self.list_services())
     return SearchKey(self.pk, self.get_absolute_url(), self.last_name,
                      display, topbody, body)
예제 #4
0
 def keyword_index(self):
     # Return a (key, url, order, display, name, body) tuple with text for indexing
     if self.posting_time.__class__ == unicode:
         posting_time = datetime(
             *time.strptime(self.posting_time, "%Y-%m-%d %H:%M:%S")[0:5])
     else:
         posting_time = self.posting_time
     return SearchKey(self.pk, self.get_absolute_url(),
                      posting_time.isoformat(), self.headline,
                      self.keywords, self.keywords)
예제 #5
0
	def search_index(self):
		# Return a (key, url, order, display, name, body) tuple with text for indexing
		# We have to fetch the body from the file
		if self.duplicate:
			return None
		try:
			t = loader.get_template(self.template)
			body = t.render(Context())
		except loader.TemplateDoesNotExist:
			raise Http404
		return SearchKey(self.article_id, self.get_absolute_url(), self.title, self.title, self.title, body)
예제 #6
0
 def search_index(self):
     # Return a (key, url, order, display, name, body) tuple with text for indexing
     if self.posting_time.__class__ == unicode:
         posting_time = datetime(
             *time.strptime(self.posting_time, "%Y-%m-%d %H:%M:%S")[0:5])
     else:
         posting_time = self.posting_time
     body = "%s %s %s" % (self.title, self.description, self.ingredients)
     return SearchKey(self.pk, self.get_absolute_url(),
                      posting_time.isoformat(), self.title, self.title,
                      body)
예제 #7
0
파일: models.py 프로젝트: cash2one/smgsite
 def keyword_index(self):
     if self.suffix:
         display = '<a href="%s">%s, %s %s, %s, <span class="doctor_cred">%s</span></a> - <span class="doctor_dept">%s</span>' % (
             self.get_absolute_url(), self.last_name, self.first_name,
             self.middle_name, self.suffix, self.letters,
             self.list_services())
     else:
         display = '<a href="%s">%s, %s %s, <span class="doctor_cred">%s</span></a> - <span class="doctor_dept">%s</span>' % (
             self.get_absolute_url(), self.last_name, self.first_name,
             self.middle_name, self.letters, self.list_services())
     # Return a (key, url, order, display, name, body) tuple with text for keyword indexing
     return SearchKey(self.pk, self.get_absolute_url(), self.last_name,
                      display, self.keywords, self.keywords)
예제 #8
0
파일: models.py 프로젝트: cash2one/smgsite
 def keyword_index(self):
     # Return a (key, url, order, display, name, body) tuple with text for keyword indexing
     return SearchKey(self.pk, self.get_absolute_url(), self.title,
                      self.title, self.keywords, self.keywords)
예제 #9
0
파일: models.py 프로젝트: cash2one/smgsite
 def search_index(self):
     # Return a (key, url, order, display, name, body) tuple with text for indexing
     body = "%s %s" % (self.title, self.content)
     return SearchKey(self.pk, self.get_absolute_url(), self.title,
                      self.title, self.title, body)
예제 #10
0
 def search_index(self):
     # Return a (key, url, order, display, name, body) tuple with text for indexing
     body = "%s %s %s %s" % (self.title, self.description,
                             self.local_presenters, self.other_presenter)
     return SearchKey(self.pk, self.get_absolute_url(), self.startdate,
                      self.title, self.title, body)
예제 #11
0
파일: models.py 프로젝트: cash2one/smgsite
 def search_index(self):
     # Return a (key, url, order, display, name, body) tuple with text for indexing
     return SearchKey(self.pk, self.get_absolute_url(), self.specialty,
                      self.specialty, self.specialty, self.specialty)