Merric Mercer wrote:
> Can anybody recommend an elegant way to achieve point this.  I can 
> retrieve the qs with all the related brand records but  I cannot work 
> out how to retrieve the query set whilst omitting the related initial 
> record.
> 
> Currently I have.
> 
> 1. qs=Child.objects.get(id= record_id)  
> 2. brand = qs.parent.brand
> 3. related_brands = Parent.objects.filter(brand=brand)

If I'm understanding you correctly, replace step 3 with:

related = Parent.objects.filter(brand=brand).exclude(id=qs.parent.id)

-Zak

--~--~---------~--~----~------------~-------~--~----~
 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to