Re: testcases

2021-03-23 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Hi! I think you've found the wrong mailing list for this post. This mailing list is for discussing the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely t

testcases

2021-03-23 Thread sangeerth sathiskumar
Hi guys im struggling with testcases. Can you help me with testcase to this implementation ? from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager # Create your models here. class AccountManager(BaseUserManager): def create_user(self, email, fir

Re: Moving rest_framework.status into core?

2021-03-23 Thread Arthur Rio
The one thing that I really prefer from DRF's statuses is their name, containing the status_code. I used python's `http.HTTPStatus` in a flask project and I had to have the python docs open all the time to map between the status code and the name of the status. For example: - http.HTTPStatus.BAD_GA

Re: Moving rest_framework.status into core?

2021-03-23 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Python 3.5 added http.HTTPStatus: https://docs.python.org/3.9/library/http.html#http.HTTPStatus , so I don't see a need for such constants in Django, unless they add something extra. Perhaps you could deprecate from DRF. On Tue, 23 Mar 2021 at 15:18, Carlton Gibson wrote: > Hiya. > > Maybe my se

Moving rest_framework.status into core?

2021-03-23 Thread Carlton Gibson
Hiya. Maybe my search-foo is down but, surprisingly, I couldn't find a discussion on this. Should we maybe bring the HTTP status code constants that we find in rest_framework.status into core, as django.http.status? I find myself wanting them (not for the first time) in a project that does

Re: Stop QuerySet repr from executing queries

2021-03-23 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Would James' suggestion of reusing the result cache in __repr__ have solved your issue? I would like to see that first. I'm not against the DEBUG-only fetching but there hasn't been any suggestion what to show instead that could be of use. One can also mitigate against bad queries particularly we

Re: Stop QuerySet repr from executing queries

2021-03-23 Thread Joachim Jablon
Just been bitten by that same bug (combination of Sentry, using a Queryset.as_manager() that creates an unfiltered queryset as a local variable in the stack, a create signal that errored provoking a stacktrace that contained the queryset, a table that is always filtered by a field, and sorted b

Django Project idea query

2021-03-23 Thread Khushi Kaushal
Hello All! I am participating in GSOC 2021. I was looking at some of the project lists and I am interested in the Django Benchmarking project idea. I would like to know more about the tasks and operations involved in this project idea. I am looking forward to contributing to the Django committee