subqueries

2013-04-15 Thread NiL
hi list, I'm willing to implement something exactly like what's described here let's say I have documents and keywords, join by a many to many relation when I display a document detail, I wish to also display other documents that have a maximum of common keyword. detailed use case here

Re: Subqueries

2011-04-10 Thread Mengu
i believe you can do this with "extra" attribute. go to http://docs.djangoproject.com/en/1.3/ref/models/querysets/ and search for subquery. you'll see how to do subqueries. On Apr 6, 5:30 pm, bernatbonet wrote: > Data Model: > class A(models.model): >    desc: mod

Subqueries

2011-04-06 Thread bernatbonet
Data Model: class A(models.model): desc: model.CharField() class B(models.model): a: model.ForeignKey('A') desc: models.CharField() I need to do this select in a view: select max(num_a) as max_num_a from (select a, count(desc) as num_a from B group by a) as x; I've tried this: result

Re: Q objects for subqueries with cross-references

2010-06-16 Thread akaariai
On 16 kesä, 21:41, rt wrote: > Hi, > >  I am having a hard time with Q objects based on subqueries. It's a > part of a linguistic corpus analysis query builder (hence Q objects as > this is how I parse and translate arbitrary queries into Django) -- > the user can s

Q objects for subqueries with cross-references

2010-06-16 Thread rt
Hi, I am having a hard time with Q objects based on subqueries. It's a part of a linguistic corpus analysis query builder (hence Q objects as this is how I parse and translate arbitrary queries into Django) -- the user can search 'posts' that meet complex criteria. Anyway, it

[bug?] using GeoManager in subqueries gives no results (Django 1.2 beta 1) + 1.1.1 bug

2010-03-22 Thread Marcin Kałuża
Hi, I'ts my first post here, so "Hello" Everyone :) I've got the code as shown below. The problem is that when I do a subquery using a previously generated queryset it doesn't return any results, if the queryset contained a geometry field (r1 here) >>> b="49.98544839116778,19.8248291015625,50.1439

Re: How to use subqueries in django

2009-11-18 Thread Radhikavk
thank you sir i found the solution -- View this message in context: http://old.nabble.com/How-to-use-subqueries-in-django-tp26387486p26408019.html Sent from the django-users mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups

Re: How to use subqueries in django

2009-11-18 Thread Karen Tracey
On Wed, Nov 18, 2009 at 2:15 AM, Radhikavk wrote: > > in one query they have giver or conditions > but i need > i wil have one common query like > list=rooms.objects.all() # this is common query i m using > > and if the condition given like room status,type etc then i need to append > those wher

Re: How to use subqueries in django

2009-11-17 Thread Radhikavk
where room_type=this else nothing i have so many search criteria , i think this appending is useful but it is giving error queryset has no attribute append -- View this message in context: http://old.nabble.com/How-to-use-subqueries-in-django-tp26387486p26402998.html Sent from the django

Re: How to use subqueries in django

2009-11-17 Thread Adam Knight
On Nov 17, 2009, at 7:49 AM, Radhikavk wrote: > > hi, > > how to use search criteria using OR and AND in queries > user can search room by no,room_type, block etc i need the combination > > > Please can you refer the tutorial http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lo

Re: How to use subqueries in django

2009-11-17 Thread Radhikavk
hi, how to use search criteria using OR and AND in queries user can search room by no,room_type, block etc i need the combination Please can you refer the tutorial -- View this message in context: http://old.nabble.com/How-to-use-subqueries-in-django-tp26387486p26390239.html Sent from the

Re: How to use subqueries in django

2009-11-17 Thread Radhikavk
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 o

Re: How to use subqueries in django

2009-11-17 Thread Radhikavk
ok i got it Thanks -- View this message in context: http://old.nabble.com/How-to-use-subqueries-in-django-tp26387486p26389937.html Sent from the django-users mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups "Django

Re: How to use subqueries in django

2009-11-17 Thread Karen Tracey
On Tue, Nov 17, 2009 at 6:43 AM, Radhikavk wrote: > > I tried this i dis not get solution > > i m getting a list from rooms table > > room_list=rooms.objects.all() > > This will give me the room type id when i print room_list.room_type_id but > for this id i need a name which is in room_types tab

Re: How to use subqueries in django

2009-11-17 Thread Radhikavk
: http://old.nabble.com/How-to-use-subqueries-in-django-tp26387486p26388551.html Sent from the django-users mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: How to use subqueries in django

2009-11-17 Thread Daniel Roseman
and to display the list of rooms the quesry should be > > select r.room_type_id,r.room_no,rt.room_type_name from room_types rt,rooms r > where rt.room_type_id=r.room_type_id > > How to give this query in django > > Thanks in advance > > -- > View this message in > cont

How to use subqueries in django

2009-11-17 Thread Radhikavk
to give this query in django Thanks in advance -- View this message in context: http://old.nabble.com/How-to-use-subqueries-in-django-tp26387486p26387486.html Sent from the django-users mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google

Re: Doing "in" subqueries on the server-side

2007-02-10 Thread Malcolm Tredinnick
On Sat, 2007-02-10 at 09:41 -0600, Tim Chase wrote: > For an app I've been assembling, I need to filter a particular > data-set based on multiple many-to-many criteria where the > criteria span multiple records in the far participant of the M2M. > The basics are the recordset (Items) and each Ite

Doing "in" subqueries on the server-side

2007-02-10 Thread Tim Chase
For an app I've been assembling, I need to filter a particular data-set based on multiple many-to-many criteria where the criteria span multiple records in the far participant of the M2M. The basics are the recordset (Items) and each Item has a M2M relationship with Properties (a key/value pair)