Wednesday, April 13, 2011

Re: referencing fields on the model without F()

Hello Yuka,

2011/4/13 Yuka Poppe <yuka@xs4all.nl>:
> You could possibly resort to the extra() queryset method, allthough it eats
> raw sql, its documented in the manual. Im not sure if its in 0.96 though.

Yes, thanks!

I think I found a solution:

hw=Hardware.objects\
.filter(rack__he__isnull=False)\
.extra(where=['`hardware`.`he`=`hardware__rack`.`he`'])

Seems to work.

Regards Roman

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate