Re: View Function Signature?

2017-05-14 Thread Nick Gilmour
> > Neither one of these is what was being asked for. I didn't say I have found what I was looking for. All answers are sufficient to me for now. Thanks. On Sun, May 14, 2017 at 10:51 PM, James Bennett wrote: > On Sun, May 14, 2017 at 1:36 PM, Nick Gilmour > wrote: > >> Definition of url: >>

Re: View Function Signature?

2017-05-14 Thread James Bennett
On Sun, May 14, 2017 at 1:36 PM, Nick Gilmour wrote: > Definition of url: > > *def url(regex, view, kwargs=None, name=None):* > > I also found this: > *def view(request, *args, **kwargs):* > > Neither one of these is what was being asked for. And like several people have said, what's being asked

Re: View Function Signature?

2017-05-14 Thread Nick Gilmour
Definition of url: *def url(regex, view, kwargs=None, name=None):* I also found this: *def view(request, *args, **kwargs):* here: *.../django/views/generic/base.py* On Sat, May 13, 2017 at 11:15 PM, Daniel Roseman wrote: > On Friday, 12 May 2017 15:11:55 UTC+1, nickeforos wrote: >> >> Thank

Re: Need help in Django User Model customization and authentication

2017-05-14 Thread Scot Hacker
This is a fairly common need in academia, where your users need a different set of profile fields depending on affiliation. And you always end up with edge cases where some people are simultaneously faculty and staff, or even student and faculty, etc. And those "special" people will need to have

Re: Aggregating a query while selecting more than grouped by ...

2017-05-14 Thread Bernd Wechner
Todor, Awesome thanks yet again! I think I'm rolling now ;-). Tested it and it looks like it works, pending some rigorous testing. The query looks good though and makes sense to me. Forgive my naivete regarding Group By. I had a thorough think about how I'd build a raw SQL version and trying

Re: Aggregating a query while selecting more than grouped by ...

2017-05-14 Thread Todor Velichkov
There is no `group_by` clause in the ORM, because this will lead to ambiguous queries. Ambiguous query is a query where you have a non-distinct column in the select, that is missing from the group_by clause. Its actually a MySQL fault for allowing it, in other RDBMS you will get an ambiguous qu

Re: Aggregating a query while selecting more than grouped by ...

2017-05-14 Thread Bernd Wechner
Why thank you very kindly Todor for these insights! And some interesting reading! It surprises me, I admit (with no intention of being judgmental) that there isn't a simpler way, perhaps like: LatestAuthors = Author.objects.filter(book_set__pubdate__lte=SOMEDATE).group_by('country').annota