Why does combining multiple annotations work in my case?

2017-08-11 Thread Marcin Gałązka
The documentation advises against combining multiple annotations in one query: https://docs.djangoproject.com/en/1.11/topics/db/aggregation/#combining-multiple-aggregations due to the infamous bug #10060: https://code.djangoproject.com/ticket/10060 And indeed, having tried the counter-example

Re: Django admin raises CSRF verification failed when changing from DEBUG True - > False

2017-08-11 Thread Ruben Alves
Same problem here. I've created a ticket: https://code.djangoproject.com/ticket/28488 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Tutorial help Blank Front page

2017-08-11 Thread Александр Христюхин (roboslone)
Hi, You should open "http://127.0.0.1:8000/polls/ " instead of "http://127.0.0.1:8000/ ". Take a look at the error Django gives you, all registered URLs are listed there. > On 11 Aug 2017, at 20:56, Kareem Hart

How to insert a row in another table once a user is created

2017-08-11 Thread Prithviraj Mitra
I am a fresher in django. I am using django 1.10 with allauth app which takes care of frontend registration, sending user confirmation email,validation, login with email etc. So it all works in the frontend. In the backend I managed to change the user creation form by adding an extra field

Tutorial help Blank Front page

2017-08-11 Thread Kareem Hart
I am currently doing the tutorial and I'm writing views. I wrote my index.html file and updated the view to use a loader and add the extra code that they provided. It tells me next to load 127.0.0.1:8000/polls and I should see a bulleted list containing the "whats up" question but my page is

Tutorial writing views help

2017-08-11 Thread Kareem Hart
I am currently up to the "writing views" part of the tutorial and just wrote the polls/index.html template. I updated the view in polls/view.py as such: from django.http import HttpResponse from django.template import loader from .models import Question def index(request):

Re: Django admin raises CSRF verification failed when changing from DEBUG True - > False

2017-08-11 Thread Ruben Alves
Same problem here. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: Dynamic View Selection

2017-08-11 Thread Russell Keith-Magee
Yes - but it doesn’t depend on some hidden feature of Django. It’s A Django View is just a function that accepts a request + args, and returns a response. That view can, itself, call other functions - including other functions that can act as views. So, you could write a “switch statement”

Dynamic View Selection

2017-08-11 Thread Khai Weng Au Yeong
Not sure if this has been covered before, but I was thinking about this for awhile. Is there a way to dynamically select a View to be used by a URL without having to replicate the URL dispatcher over and over via a "superceding" like method. Like for example, in my project (let's say it's

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-11 Thread guettli
Am Freitag, 11. August 2017 10:05:00 UTC+2 schrieb James Schneider: > > >> My concern is that this python code can't return a queryset with all > items where a given permission+user tuple match. > > > def has_perm(obj, user): > if user.is_superuser: > return True > > This means I

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-11 Thread guettli
Am Donnerstag, 10. August 2017 14:30:31 UTC+2 schrieb Vijay Khemlani: > > It's still implemented like that in the background, but I'm not sure why > do you call it slow. > > Did you run benchmarks? Profiling? > > Usually your own business logic will be the bottleneck of your > application, not

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-11 Thread James Schneider
> My concern is that this python code can't return a queryset with all items where a given permission+user tuple match. def has_perm(obj, user): if user.is_superuser: return True This means I need a SQL WHERE condition For example MyModel.objects.filter(Q(...)|Q()) I never