Re: Custom joins on multiple columns with Q objects

2008-11-18 Thread David Elias
Another thing i can't resolve is construct contraints based in another model other than the query original one. With 0.96 i just passed the Options object - "q_filter.get_sql (other_model._meta)". Now I've tried: class QJoin(object): ... def add_to_query(self, query, used_aliases):

Re: Custom joins on multiple columns with Q objects

2008-11-15 Thread David Elias
Malcolm Tredinnick wrote: > At some point in the future, multi-valued ON constraints might make an > appearance (for example, multi-column primary key queries are possibly > easier to write), but they might not, too. The slight preference for > doing so at some point is that there are a couple of

Re: Custom joins on multiple columns with Q objects

2008-11-14 Thread Malcolm Tredinnick
On Fri, 2008-11-14 at 08:10 -0800, David Elias wrote: > I'm using with Django 0.96 a custom Q object to make joins between > models, here's an example: > > class Product(models.Model): > group = models.IntegerField() # primary key > code = models.CharField() # primary key > name = mo

Custom joins on multiple columns with Q objects

2008-11-14 Thread David Elias
I'm using with Django 0.96 a custom Q object to make joins between models, here's an example: class Product(models.Model): group = models.IntegerField() # primary key code = models.CharField() # primary key name = models.CharField() ... class CartItem(models.Model): product_g