Re: ForeignKey search

2010-12-14 Thread Michele JD Granocchia
Ys thanks a lot :) > > Why not just: > > cl2 = > Class2.objects.filter(fieldwfk__field1__icontains=searchtext).order_by('-id') -- 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...@google

Re: ForeignKey search

2010-12-13 Thread Daniel Roseman
On Monday, December 13, 2010 2:54:12 PM UTC, Michele JD Granocchia wrote:(django 1.2) Hi, i need to do the following: Class 1, with a field called "field1" (CharField) Class 2, with a field called "fieldwfk" (ForeignKey) User enters a text and submits, which goes into "searchtext" --- searchtext

ForeignKey search

2010-12-13 Thread Michele JD Granocchia
(django 1.2) Hi, i need to do the following: Class 1, with a field called "field1" (CharField) Class 2, with a field called "fieldwfk" (ForeignKey) User enters a text and submits, which goes into "searchtext" --- searchtext = request.GET.get('text') Now i want to get all Class2 objects WHERE fi