Re: get_list() with foreignkey-parameters
thanks. i then used milestone_list = milestones.get_list(responsible__id__exact=request.user.id) to display the milestones for the logged-in user. seems to work. Am 19.12.2005 um 17:07 schrieb Adrian Holovaty: On 12/19/05, patrick kranzlmüller <[EMAIL PROTECTED]> wrote: this works fine: milestone_list = milestones.get_list(id__exact=3, order_by=['-id']) this doesn´t: milestone_list = milestones.get_list(responsible__exact=1, order_by=['-id']) the model looks like; responsible = meta.ForeignKey(auth.User) Try this: milestone_list = milestones.get_list(responsible__id__exact=1) You can also do something like this: milestone_list = milestones.get_list(responsible__username__exact='patrick') Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org
Re: get_list() with foreignkey-parameters
Hello patrick kranzlm_ller! On Mon, 19 Dec 2005 17:03:21 +0100 you wrote: > > first issue: > > this works fine: > milestone_list = milestones.get_list(id__exact=3, order_by=['-id']) > > this doesn_t: v> milestone_list = milestones.get_list(responsible__exact=1, > order_by=['-id']) milestone_list = milestones.get_list(responsible__id__exact=1, order_by=['-id']) > the model looks like; > responsible = meta.ForeignKey(auth.User) > -- Всего наилучшего! greg [at] anastasia [dot] ru Григорий.
Re: get_list() with foreignkey-parameters
Hi Patrick, > this doesn´t: > milestone_list = milestones.get_list(responsible__exact=1, > order_by=['-id']) Try this: milestone_list = milestones.get_list(responsible__id__exact=1, order_by=['-id']) "1" is the user's id, so this should work: milestone_list = milestones.get_list(responsible__id__exact=user.id, order_by=['-id']) Cheers, Andreas On 12/19/05, patrick kranzlmüller <[EMAIL PROTECTED]> wrote: > > first issue: > > this works fine: > milestone_list = milestones.get_list(id__exact=3, order_by=['-id']) > > this doesn´t: > milestone_list = milestones.get_list(responsible__exact=1, > order_by=['-id']) > > the model looks like; > responsible = meta.ForeignKey(auth.User) > > > second issue: > > i´m now able to display the username with my app. still, i´d like to > have something like > milestone_list = milestones.get_list(responsible__exact=user.id, > order_by=['-id']) > > i don´t know if this is correct for "responsible__exact" is obviously > wrong. > > thanks in advance. > patrick > >
Re: get_list() with foreignkey-parameters
On 12/19/05, patrick kranzlmüller <[EMAIL PROTECTED]> wrote: > this works fine: > milestone_list = milestones.get_list(id__exact=3, order_by=['-id']) > > this doesn´t: > milestone_list = milestones.get_list(responsible__exact=1, > order_by=['-id']) > > the model looks like; > responsible = meta.ForeignKey(auth.User) Try this: milestone_list = milestones.get_list(responsible__id__exact=1) You can also do something like this: milestone_list = milestones.get_list(responsible__username__exact='patrick') Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org
get_list() with foreignkey-parameters
first issue: this works fine: milestone_list = milestones.get_list(id__exact=3, order_by=['-id']) this doesn´t: milestone_list = milestones.get_list(responsible__exact=1, order_by=['-id']) the model looks like; responsible = meta.ForeignKey(auth.User) second issue: i´m now able to display the username with my app. still, i´d like to have something like milestone_list = milestones.get_list(responsible__exact=user.id, order_by=['-id']) i don´t know if this is correct for "responsible__exact" is obviously wrong. thanks in advance. patrick