down votefavorite
<https://stackoverflow.com/questions/44998803/django-inner-join-queryset-where-there-is-no-foreign-key-relation-between-two-ta/44998962?noredirect=1#>
Please Help ! I Want to know the inner join Queryset for the below
mentioned raw oracle Query : -
On Jul 28, 2010, at 6:02 PM, kostia wrote:
Well, I used
projects = projects.filter(favourites__user = request.user)
And then I tired to order by 'date' field, which is in the Favourite
model like here:
projects = projects.filter(favourites__user =
request.user)#.order_by(filter_field)
And it
Well, I used
projects = projects.filter(favourites__user = request.user)
And then I tired to order by 'date' field, which is in the Favourite
model like here:
projects = projects.filter(favourites__user =
request.user)#.order_by(filter_field)
And it throws me an error: "Cannot resolve keyword '
On Jul 28, 2010, at 5:19 PM, kostia wrote:
Thank you very much Roald,
What is faster:
projects = Project.objects.filter(favourites__user = request.user)
or
select_related('project')
?
I think it doesn't matter much, but if one is faster, it should be the
first one. If you only use the
On Jul 28, 4:16 pm, backdoc wrote:
>
>
>
>
> > fav_and_projs = ((f, f.project) for f in favourites)
>
> This may not be a Django question. But, I'm not familiar with this syntax.
> Is this returning a tuple for ever item in favourites? So, fav_and_projs
> would be a tuple of tuples, like ((f1
Thank you very much Roald,
What is faster:
projects = Project.objects.filter(favourites__user = request.user)
or
select_related('project')
?
Kostia
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dj
>
>fav_and_projs = ((f, f.project) for f in favourites)
>
This may not be a Django question. But, I'm not familiar with this syntax.
Is this returning a tuple for ever item in favourites? So, fav_and_projs
would be a tuple of tuples, like ((f1, f.project1), (f2, fproject2),
.(fn, fproje
Dear Kostia
On Jul 28, 2010, at 2:29 PM, kostia wrote:
I have a model Favourite with fields User, Project, Date, what means
that some user put some project as favourite on some date. I take all
favourites filtered by this user and I want to INNER JOIN that info
with Project model. How can I do t
Still need your help
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options,
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
class Project(models.Model):
author = models.ForeignKey(User, verbose_name=_('Author'),
related_name='projects')
title = models.CharFiel
It would help if you submitted your models
- Sævar
On Jul 28, 2:29 pm, kostia wrote:
> I have a model Favourite with fields User, Project, Date, what means
> that some user put some project as favourite on some date. I take all
> favourites filtered by this user and I want to INNER JOIN that info
I have a model Favourite with fields User, Project, Date, what means
that some user put some project as favourite on some date. I take all
favourites filtered by this user and I want to INNER JOIN that info
with Project model. How can I do that?
Something like projects = Favourite.objects.filter(u
12 matches
Mail list logo