On Fri, May 30, 2008 at 6:09 PM, robstar <[EMAIL PROTECTED]> wrote:
>
> Thanks for your help Richard.. taking out the select_related()
> results in the same problem. Isn't a OnetoOneField just a fancy name
> wrapper for a foreign key??
>
> mysql> describe itemengine_gear;
> +-+-
Thanks for your help Richard.. taking out the select_related()
results in the same problem. Isn't a OnetoOneField just a fancy name
wrapper for a foreign key??
mysql> describe itemengine_gear;
+-+--+--+-+-+---+
| Field | Type |
Wah, nevermind ..
Am 30.05.2008 um 01:27 schrieb Johannes Dollinger:
>
>> Should this work??
>>
>> results = Gear.objects.select_related().order_by
>> (generic_info__hits)
>
> Quotes are missing:
>
> Gear.objects.select_related().order_by('generic_info__hits')
>
>
>
>
>
> >
--~--~-
> Should this work??
>
> results = Gear.objects.select_related().order_by(generic_info__hits)
Quotes are missing:
Gear.objects.select_related().order_by('generic_info__hits')
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
I am not sure what is going on, however I wonder if it has something to do
with the OneToOne relationship, I do not use onetoone myself but notice in
the following from the db-api documentation:
Note that the select_related() QuerySet method recursively prepopulates the
cache of all one-to-many re
Oops, I had the ' ' in there somewhere in all my different iterations
of trying to make this work .. so the query works, but I can't access
the object in the template, or from the shell for that matter. Does
something change by doing this type of query?
On the shell:
>>> gear = Gear.objects.se
Oops, I had the ' ' in there somewhere in all my different iterations
of trying to make this work .. so the query works, but I can't access
the object in the template, or from the shell for that matter. Does
something change by doing this type of query?
On the shell:
>>> gear = Gear.objects.se
http://www.djangoproject.com/documentation/db-api/
contains the info you want. Try this:
Gear.objects.select_related().order_by('generic_info__hits')
you could also set the order_by in the Meta of Item to hits and then you
could just do:
Gear.objects.select_related().order_by('generic_info')
ht
Hey guys,
I read through some of the threads here, but still can't get this
simple scenario to work..
DB name: gcdb
class Item(models.Model):
hits= models.IntegerField(default=0)
class Gear(models.Model):
generic_info= models.OneToOneField(Item)
Should this work??
res
9 matches
Mail list logo