Hi, here's my search index:

import datetime
from haystack import indexes
from haystack import site
from profiles.models import Profile

class ProfileIndex(indexes.SearchIndex):
    text       = indexes.CharField(use_template=True, document=True)
    first_name = indexes.CharField(model_attr='first_name')
    last_name  = indexes.CharField(model_attr='last_name')
    about      = indexes.CharField(model_attr='about')
    interests  = indexes.CharField(model_attr='interests')

    def get_queryset(self):
        return Profile.objects.all()

site.register(Profile, ProfileIndex)

I don't know if it helps, but here's my profile_text.txt

{{ object.user.username }}
{{ object.first_name }}
{{ object.last_name }}

and my Profile model

class Profile(models.Model):

    user = models.ForeignKey(User, unique=True, verbose_name=_('user'))
    first_name = models.CharField(_('first_name'), max_length=30,
null=False, default='')
    last_name = models.CharField(_('last_name'), max_length=70, null=False,
default='')
    age   = models.IntegerField(_('age'), null=True)
    about = models.TextField(_('about'), null=True, blank=True)
    interests = models.TextField(_('interests'), null=True, blank=True)
    birth_date = models.DateField(_('birth_date'), null=False,
default='1900-01-01')
    location = models.CharField(_('location'), max_length=40, null=True,
blank=True)
    state    = models.CharField(_('state'), choices=STATE_CHOICE,
 max_length=40, null=True, blank=True)
    country  = models.CharField(_('country'), max_length=40, null=True,
blank=True)
    website = models.URLField(_('website'), null=True, blank=True)
    account_type = models.ForeignKey(AccountType, verbose_name=('account
type'), null=True)


and it was working at Mac, so I believe it's a misconfiguration or
misinstallation

On Tue, Dec 21, 2010 at 3:00 AM, Sam Lai <samuel....@gmail.com> wrote:

> 2010/12/21 Daniel França <daniel.fra...@gmail.com>:
> > anyone?
> >
> > 2010/12/19 Daniel França <daniel.fra...@gmail.com>
> >>
> >> Hi all
> >> I was using haystack(xapian) at a Mac, so I moved it to a Linux (Ubuntu
> >> 10.10) using python 2.6.6, but now when I try to rebuild the index I get
> the
> >> following error:
> >> AttributeError: 'ProfileIndex' object has no attribute 'full_prepare'
> >> ProfileIndex is my index, I didn't created a full_prepare atribute, but
> I
> >> wonder that haystack created that for me, right?
>
> full_prepare is a method in the SearchIndex class in Haystack. Does
> ProfileIndex inherit from SearchIndex?
>
> Maybe haystack isn't installed properly and Python can't find the
> SearchIndex class? Although that should be a different error I
> believe.
>
> >> Anyone has any idea where can be the error? and how can I fix it?
> >>
> >> my Django version: 1.2.3
> >> Best Regardds,
> >> Daniel França
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to