and i solved it in the view. dont know if this is the right way but it
works:
def topic_detail(request, slug):
topic = get_object_or_404(Topic, slug=slug)
t = topic.project_set.all()
techlist = []
for p in t:
for t in p.technologies.all():
if t in techlist:
ok im still stucking on this one:
i dont think the regroup tag can help in this case
but i cant understand how i can query the technologies used within a
specific topic.
i mean i have alredy the projects assigned to this topic, now i need the
technologies used by this projects.
any ideas?
It looks like the problem is that you're trying to group by
Technology, but your queryset is in Projects. You could experiment
with the "regroup" template tag
( http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup
)
It's a little hard to understand at first, but I think it's prett
hi,
i have a question about retrieving related objects avoiding double entries.
actually i have 3 models:
topics
projects
technologies
the projects model has foreignkeys to topics and technologies. i have a
view for the topic detail like this:
def topic_detail(request, slug):
4 matches
Mail list logo