On 11/1/05, stava <[EMAIL PROTECTED]> wrote:
> class State(meta.Model):
> state = meta.CharField(maxlength = 12, primary_key = True)
>
> class Item(meta.Model):
> wdate = meta.DateField()
> state = meta.ForeignKey(State)
>
> % python
> >>> from django.models.ttime import *
> >>> items.get_list(state__id__in = ['Open'])
> [snip]
> TypeError: got unexpected keyword argument 'state__id__in'
>
> I've read the "Field lookups" section of the "Database API reference",
> and my understanding is that the field key should be available. I've
> also tried "state__in", "state_id__in".
"state__id" isn't working because none of your fields are called "id".
The database API uses the field names. In your case, the field name is
"state", so here's what you'd want:
items.get_list(state__state__in=['Open'])
The first "state" refers to the "state" field in Item. The second
refers to the "state" field in State.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org