Форум сайта python.su
Hi.
Для одного приложения требуется djapian.
Следуя инструкции установлено djapian и xapian.
Затем в models.py пишу :
post_index = Indexer(
path = '/tmp/'
model = Post,
fields = [('subject', 20), 'body'],
tags = [
('subject', 'subject', 20),
('date', 'postdate'),
('category', 'category.name'),
('post_id', 'id'),
('category_id', 'category.id'),
('group_id', 'category.group.id'),
])
post_index.boolean_fields = ('category_id', 'group_id',)
r@r:~/project$ ./manage.py syncdb
Traceback (most recent call last):
File "./manage.py", line 13, in <module>
execute_manager(settings)
File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 350, in execute_manager
utility.execute()
File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 295, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 195, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 221, in execute
self.validate()
File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 249, in validate
num_errors = get_validation_errors(s, app)
File "/usr/lib/python2.5/site-packages/django/core/management/validation.py", line 28, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/usr/lib/python2.5/site-packages/django/db/models/loading.py", line 128, in get_app_errors
self._populate()
File "/usr/lib/python2.5/site-packages/django/db/models/loading.py", line 57, in _populate
self.load_app(app_name, True)
File "/usr/lib/python2.5/site-packages/django/db/models/loading.py", line 72, in load_app
mod = __import__(app_name, {}, {}, ['models'])
File "/home/r/project/django/mysites/notary/apps/sphene/sphsearchboard/models.py", line 103, in <module>
('group_id', 'category.group.id'),
TypeError: __init__() got an unexpected keyword argument 'fields'
Отредактировано (Апрель 2, 2009 18:07:07)
Офлайн
Разобрался с этой проблемой. То было то что код выполнен для версии джапана 1.x а сам джапан я установил 2.0
:)
Офлайн