On Nov 23, 2010, at 9:09 PM, sh...@bogomip.com wrote:
> Since you've noticed it I have to ask.. since I didn't think it would
> be any different.. how does this differ from the current Django
> method?

The standard Django implementation creates an intermediate table with foreign 
keys back to the tables on each side, so it's simple to do a query against that 
intermediate model to handle queries like that.  (This is the standard SQL way 
of handling a many-to-many relationship.)

In fact, in your structure, I'm not sure you can actually answer the question 
"which items refer to user 1," since that information is lost into the hash.  
If the only question you ever need to answer is "does item 1 refer to this 
particular set of users?", then that's not a big deal.

>> If you are using PostgreSQL, you might look at using intarray or hstore 
>> fields instead; those have the same advantages you enumerate, but you can 
>> also index on them in ways that will speed up searches for individual values.
> 
> Outside of the ORM I'll play around with this.

You don't need to abandon the ORM to use hstore or intarray; they adapt very 
nicely to Pyython types and Django model types.

--
-- Christophe Pettus
   x...@thebuild.com

-- 
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