Hi Laurent,

On Wed, 2006-07-19 at 11:19 +0200, Laurent RAHUEL wrote:
> Hi,
> 
> Does anybody already managed to use a Tsearch2 enabled table with django ORM.
> Imagine you defined a model that creates this kind of table :
> 
> CREATE TABLE newsitem (
>     id INT PRIMARY KEY,
>     newstitle VARCHAR(255),
>     newscontent TEXT,
>     authorid INT,
>     newsdate TIMESTAMP
> );
> 
> In order to use tsearch2 for a full text search for this table is to add a 
> column this way :
> 
> ALTER TABLE newsitem ADD COLUMN newscontent_fti tsvector;
> 
> You noticed the type of this column which is tsvector. Now my django model is 
> not representative of my table and I can not add this new column in my model 
> because tsvector is not a know type of django.
> 
> Do you think this manipulation won't bother my django app ?

You can quite happily and confidently do this. Django refers to all
columns by name when it does queries, so it won't every query any
information from the extra columns and it will not be distracted by them
either.

In fact, if you have a look at [1], you will see Adrian describing a
very similar solution when he used Postgresql's GIS field.

[1]
http://groups.google.com/group/django-users/browse_frm/thread/1fbbaf710996a8aa/b5d5fbc9db2bfb52?rnum=1#b5d5fbc9db2bfb52

Best wishes,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to