Re: QuerySet.iterator together with prefetch_related because of chunk_size

2019-01-14 Thread Adam Johnson
> > ...what if we required chunk_size to be explicitly specified when the > queryset has prefetch lookups? This seems reasonable, but would you do in the case chunk_size isn't explicitly defined - throw an exception? Currently it silently fails to prefetch which means N + 1 queries, so even

Re: thoughts for Django fellowship applicants

2019-01-10 Thread Adam Johnson
Tim, Without your hard work and dedication, I would probably have never had any momentum on my PR's, and I would not have become engaged with the Django code and community. You've been hard-working, dependable, methodic, knowledgable, an inspiration, and overall excellent. It will be hard for any

Re: [Feature Request] DetailView, DeleteView, UpdateView should not work with only slug and primary key field?

2019-01-02 Thread Adam Johnson
> > In real projects primary key and slugs are not used fetch data, a more > abstract unique key is preferred. In my experience it's normally primary key that is used. In a recent project, I've used hashid fields as primary keys to avoid the problem of leaking database PK's, which is the main

Re: CSRF Middlware and usage of request attributes (META, csrf_cookie_needs_reset)

2019-01-01 Thread Adam Johnson
Thanks Luke for your look-again-later self code review :) On Tue, 1 Jan 2019 at 16:51, Luke Plant wrote: > Hi Florian, > > My own instincts would be steer away from writing to request.META for most > things, because request.META also contains things from the environment and > indeed from the

Re: CSRF Middlware and usage of request attributes (META, csrf_cookie_needs_reset)

2018-12-30 Thread Adam Johnson
> > Unless we documented the attributes/keys I'd consider it an implementation > detail of the middleware. Fair enough, I think I'm becoming a bit too conservative :) On Sat, 29 Dec 2018 at 22:13, Florian Apolloner wrote: > Hi Adam, > > On Saturday, December 29, 2018 at 7:59

Re: CSRF Middlware and usage of request attributes (META, csrf_cookie_needs_reset)

2018-12-29 Thread Adam Johnson
It looks like it dates back to the Django 1.1 refactor and extension in https://github.com/django/django/commit/8e70cef9b67433edd70935dcc30c621d1e7fc0a0 ticket #9977, for which the referred wiki page ( https://code.djangoproject.com/wiki/CsrfProtection) is still up too with rationales about the

Re: RFC: #30053 Allow for conditional QuerySet.update_or_create()

2018-12-28 Thread Adam Johnson
I think the use case is probably quite niche, and I'd like to know some more concrete details than the current comment on the ticket "(E.g. only update if the value of a DateTimeField is less than some value)". It may be there's a way to achieve the same application-level outcome using a different

Re: A faster paginator for django

2018-12-23 Thread Adam Johnson
(I think you meant https://datatables.net/ ? ) :) On Sun, 23 Dec 2018 at 19:25, Dan Davis wrote: > Also, it can be worse than one count query. When interacting with > datables.net serverSide, you will need multiple count queries. > > On Sat, Dec 15, 2018, 10:32 AM Kye Russell >> It might also

Re: [Feature Request] django-admin migrate - skip feature

2018-12-20 Thread Adam Johnson
There's a new answer on your stack overflow post that I think answers your question: https://stackoverflow.com/a/53870659/1427135 . The database router can already do it :) On Thu, 20 Dec 2018 at 07:23, Fábio Molinar wrote: > Hi, > > I have a project with two apps (app1, app2). App1's DB is the

Re: A faster paginator for django

2018-12-05 Thread Adam Johnson
There are already some packages on listed on djangopackages that claim to implement different pagination strategies: https://djangopackages.org/grids/g/pagination/ On Wed, 5 Dec 2018 at 12:37, Jason Johns wrote: > https://www.citusdata.com/blog/2016/03/30/five-ways-to-paginate/ has some >

Re: TestCase.setUpTestData in-memory data isolation.

2018-11-30 Thread Adam Johnson
Hunar - it's best to start a separate thread for different topics, and even better to check a support channel first, like the IRC channels. I think you might be looking for how to contribute translations - start here: https://docs.djangoproject.com/en/dev/internals/contributing/ . Or if you just

Re: TestCase.setUpTestData in-memory data isolation.

2018-11-28 Thread Adam Johnson
cation warning suggesting > using setUpClass or direct class attributes assignment? Another alternative > could be to silently ignore deepcopy failures and return the original > objects in these cases. > > Simon > > Le dimanche 25 novembre 2018 03:53:48 UTC-5, Adam Johnson a écrit

Re: Removing Oracle from Django core in 3.0

2018-11-25 Thread Adam Johnson
Interestingly, I didn't receive your first email Johannes, only Tim's reply. I can't even find it in spam. Maybe Gmail's filters highly associate mentions of "Oracle" with spam? :/ I agree that with Tim that it's going to be easier to keep it in core if development is going to continue. Any

Re: TestCase.setUpTestData in-memory data isolation.

2018-11-25 Thread Adam Johnson
I have run into this problem myself in the past. On a previous project we added a helper function to make deepcopy's of named attributes during setUp(). >From a check against a few projects and Django's test suite[2] I have only > identified a single issue which is that attributes assigned during

Re: Password reset emails in combination with click tracking do not work with Intelligent Tracking Prevention on Safari for iOS 12 and macOS Mojave

2018-11-25 Thread Adam Johnson
It sounds to me that this your email provider rewriting the link to go through their tracking site, and Safari now blocks the tracking site. I don't see how Django can do anything around this - the "internal token redirect" (which I guess means a Django generated redirect from one page to another

Re: Intended effect of returning None from ManifestFilesMixin.file_hash

2018-11-25 Thread Adam Johnson
That does seem like an unintentional bug, since the code is forming a string under the condition "if file_hash is not None:". On Sun, 25 Nov 2018 at 03:26, Richard Campen wrote: > Hello > > I am currently looking at implementing a custom file hashing function when > using the ManifestFilesMixin

Re: Pluggable secret key backend

2018-11-18 Thread Adam Johnson
Very good point. I'd prefer a second setting though, named like OLD_SECRET_KEYS or VERIFICATION_SECRET_KEYS. If we're going to add a new setting, we might as well not force users who aren't rotating their keys to the new one, especially if they are semantically different. On Sun, 11 Nov 2018 at

Re: Postgres PGCrypto in Django?

2018-11-17 Thread Adam Johnson
Although I admire the work that has gone into the package, I think it's best kept separate. As the creator of Django-MySQL I did once propose merging parts of it as django.contrib.mysql, but I cooled to the idea when I realized it's easier to make changes when not kept in lock-step with Django.

Re: Add Python 3.7 support for Django 1.11?

2018-11-17 Thread Adam Johnson
Since it's about 3 lines in django itself, I think it's a good idea to backport and save users the pain. On Fri, 16 Nov 2018 at 15:37, Ramiro Morales wrote: > On Fri, Nov 16, 2018 at 12:32 PM Tom Forbes wrote: > >> Do we have an idea of how many fixes would need to be backported? >> > > >

Re: Best framework for mocking in django

2018-11-15 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support using Django. Please use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On Thu, 15 Nov 2018 at 06:02, Abhishek Pandey wrote: > Hi please help me to find best mocking

Re: Django Courier Management System Project

2018-11-13 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support using Django. Please use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On Tue, 13 Nov 2018 at 08:06, Dipankar wrote: > Are you planning for open source or your

Re: skipping elidable migrations

2018-11-10 Thread Adam Johnson
Do you have an example? If you're using Django's default testing framework, it normally creates a fresh database, so from the moment a new data migration is written it would be tested with the empty database scenario. Afaiu it is possible to write RunPython operations in a way that no-ops on

Re: Allow skipping CSRF check for Referer header

2018-11-10 Thread Adam Johnson
ture flag in Firefox. :/ ( > https://bugzilla.mozilla.org/show_bug.cgi?id=1424076) > > On Saturday, November 10, 2018 at 1:03:08 AM UTC+1, Adam Johnson wrote: >> >> I also discovered a similar problem recently when deploying the >> "Referrer-Policy" header using James

Re: Pluggable secret key backend

2018-11-10 Thread Adam Johnson
Hi Andreas I like your proposal, moving to a backend is an elegant way of solving both the immediate problem and opening up the other possibilities you mentioned. I think it would also be nice to have an "out of the box" way of rotating the key, without needing to implement a custom backend.

Re: Allow skipping CSRF check for Referer header

2018-11-09 Thread Adam Johnson
I also discovered a similar problem recently when deploying the "Referrer-Policy" header using James Bennett's library: https://django-referrer-policy.readthedocs.io/en/stable/ . Initially I opted for 'no-referrer' as I figured it was the most secure, but since this check is only done on

Re: A server error occurred. Please contact the administrator

2018-11-06 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On Tue, 6 Nov 2018 at 11:53, Muhammad Tahir wrote: > hello everybody, > when i try to access

Re: Proposal to remove ModelAdmin's collection of actions from superclasses

2018-11-05 Thread Adam Johnson
I agree, it shouldn’t be doing something so surprising and undocumented. On Mon, 5 Nov 2018 at 17:03, Tim Graham wrote: > Hi, > > A recent bug report [1] brought up the fact that ModelAdmin collects > actions from superclasses. For example: > > class BaseAdmin: > actions = ['a'] > > class

Re: Requiring sqlparse for sqlite introspection

2018-11-04 Thread Adam Johnson
jango project doesn't necessarily use. We >>> also have the requires_sqlparse_for_splitting feature flag which we could >>> remove if we can assume sqlparse is installed. >>> >>> On Sunday, October 28, 2018 at 4:59:54 AM UTC-4, Adam Johnson wrote: >>>> >&

Re: Introspection of querysets

2018-11-03 Thread Adam Johnson
I have code in my package Django-MySQL that uses the internals of querysets. It’s not so bad to maintain with enough test coverage and ensuring it keeps up to date with the latest Django. The fact the interface is private means that it could change at any time, but practically that doesn’t mean

Re: Using forms for bulk records

2018-11-03 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-usersmailing list for that, or IRC #djangoon freenode, or a site like StackOverflow. On Sat, 3 Nov 2018 at 13:48, Elias Coutinho wrote: > Good morning people. > > As always my problem is conceptual. I

Re: Idea: Allow queryset.get() and queryset.filter() to accept a positional argument for implicit primary key filtering

2018-11-01 Thread Adam Johnson
Count me as -1 too, it doesn't seem worth it to me to save the 3 characters 'pk='. It would increase complexity of implementation and complexity of comprehension ("two ways to do it"). On Wed, 31 Oct 2018 at 23:00, Ian Foote wrote: > I'm not in favour of this, it's too implicit for my liking

Re: python-memcached seems to be unmaintained

2018-10-29 Thread Adam Johnson
I’ve used pymemcache with Django and even wrote a backend for it that I never got to open sourcing. I’d be glad of support in core and would help with code review. On Mon, 29 Oct 2018 at 00:42, Adrian Turjak wrote: > Through some of my last few projects using Django and Memcached I kept >

Re: Standalone is_safe_url() function

2018-10-28 Thread Adam Johnson
> > I needed that functionality on another project that doesn't use Django at > all. > If this was my own project, I would have installed Django and imported the function. Afaict it doesn't depend on settings or any other setup so it should work from an import. The only concern would be size of

Re: Requiring sqlparse for sqlite introspection

2018-10-28 Thread Adam Johnson
I'm fine with adding it as a dependency, my experience has been that it's a stable, well-maintained package over the past few years I've used it. On Sun, 28 Oct 2018 at 05:00, charettes wrote: > After a bit of work to minimize the cases where sqlparse would be a > required at runtime for SQLite

Re: Ticket/Issue Tracker

2018-10-27 Thread Adam Johnson
t a >> couple of months, so thank you for sharing this. I agree that finding >> tickets is one of the big problems here, both for new contributors and for >> sprint leaders. At Pycon UK I took on the role of sprint leader along with >> Adam Johnson and directing people to app

Re: Adding a database-agnostic JSONField into Django

2018-10-20 Thread Adam Johnson
The main thing is that MySQL added a binary JSON type, whilst MariaDB just made the JSON type an alias for TEXT (plus the corollaries that implies): https://mariadb.com/kb/en/library/json-data-type/ On Sat, 20 Oct 2018 at 21:36, Tom Forbes wrote: > Awesome work! Would you mind elaborating on

Re: django admin not working

2018-10-20 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On Sat, 20 Oct 2018 at 05:31, Muhammad Tahir wrote: > Hello everyone, > i am following django tutorial (localhost)

Re: invalid literal for int() with base 10: ''

2018-10-15 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On Mon, 15 Oct 2018 at 14:57, Moses Mugisha wrote: > Can you post to stackoverflow instead?. You are probably

Re: column "" must appear in the GROUP BY clause or be used in an aggregate function

2018-10-15 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On Mon, 15 Oct 2018 at 02:36, 徐军明 wrote: > Django 2.1.2, Postgres 10 > > Model: > class Product(models.Model): >

Re: django.contrib.auth CLI

2018-10-10 Thread Adam Johnson
This sounds like it could be useful but not sure how many projects manage their Django users through config management commands like this. Whilst you say it would be useful in core, if you had a concrete implementation in a third party app that would provide more to talk about, and allow you to

Re: Adding a database-agnostic JSONField into Django

2018-10-04 Thread Adam Johnson
I'd be up for helping with a database-agnostic one. One thing to note about MySQL world is that MariaDB diverges more from MySQL here and I haven't found the time to fix the differences here in Django-MySQL's JSONField. I'd get on with it if I knew someone needed the work for a DB-agnostic field

Re: Can we remove FILE_CHARSET?

2018-10-03 Thread Adam Johnson
Jon's logic seems right to me. I find the lack of tests disturbing, and I wouldn't be surprised if there were other places where django loaded files from disk without using FILE_CHARSET when a user of that setting would expect it to be. On Wed, 3 Oct 2018 at 15:55, Carlton Gibson wrote: >

Re: Content types shouldn't be created on post_migrate signal

2018-10-03 Thread Adam Johnson
Wouldn't a workaround be to call create_contenttypes() in a RunPython in your app's migration before inserting the data which depends on the content types? On Wed, 3 Oct 2018 at 12:01, Marcin Nowak wrote: > Hello. > > There is a huge issue with content types framework. The data is loaded >

Re: hi this is nagarjuna j, i need some help

2018-09-27 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. Also your question is very unspecified, if you're looking for tutorials on building django applications with a JSON

Re: 301 vs 308 in default redirect class for CommonMiddleware

2018-09-26 Thread Adam Johnson
ject.com/en/2.1/ref/request-response/#httpresponse-subclasses > > We could also mention the 308 redirect at the end of the class docstring > here > https://docs.djangoproject.com/en/2.1/_modules/django/middleware/common/ > > Cheers, > Matthieu > > > > On Tuesday, 18 Se

Re: 301 vs 308 in default redirect class for CommonMiddleware

2018-09-18 Thread Adam Johnson
This is historical, 307 and 308 were added later, and I think we couldn't change it without breaking backwards compatibility. That said, 307 and 308 classes could be added to django.http.response and the documentation could recommend their use. Mozilla docs show that they're compatible with all

Re: RFC732 (a.k.a. brotli) support

2018-09-16 Thread Adam Johnson
> > I would require some kind of configuration to define which response > content-type should be encoded by which algorithm. I think there's room there to support custom tactics, for example content length may also be useful to determine which algorithms are applicable, or perhaps compression

Re: Adding a bulk_save method to models

2018-09-15 Thread Adam Johnson
Bikeshed time. I'm also against bulk_save for the same reason that it implies save(). bulk_update sounds okay to me, update() is indeed already a 'bulk' operation but it could be claimed this is doing a 'bulk' amount of update operations. bulk_update_fields also sounds good, the longer method

Re: #29752 Adding a ALLOWED_HOSTS_IGNORABLE_URLS setting

2018-09-14 Thread Adam Johnson
The snippet Matt posted is the same technique I've used for ages, albeit using the ec2-metadata library. I think it's perfectly fine as-is, the Host header EC2 uses is actually predictable as the EC2 Private IP. I don't think Django needs another

Re: RFC732 (a.k.a. brotli) support

2018-09-14 Thread Adam Johnson
Sounds like a good idea to me. Would you be looking at merging any code from django-brotli, and have you been in contact with its creator and license holder Vasek Dohnal? And what kind of methods around Accept-Encoding are you imagining? On Fri, 14 Sep 2018 at 09:01, Johannes Hoppe wrote: >

Re: Adjusting MRO of the CBVs

2018-09-11 Thread Adam Johnson
So it's not just fellows posting: I agree. On Mon, 10 Sep 2018 at 16:16, Tim Graham wrote: > I agree that it's not worthwhile. There are alternatives like > http://django-vanilla-views.org/. > > On Thursday, September 6, 2018 at 3:51:29 AM UTC-4, Carlton Gibson wrote: >> >> There's a ticket

Re: audio file

2018-09-10 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. Also your question is more to do with HTML than Django. On Sun, 9 Sep 2018 at 22:18, Mustafa Ryad wrote: > Is

Re: OneToOneField not updating relationship with reverse relation after refresh_from_db()

2018-09-04 Thread Adam Johnson
Correct, refresh_from_db() is expected to only update the current model, not traverse to others linking it (which could be *many*). You'd want m.refresh_from_db() to refresh the fact that the user field on m has changed. On Sun, 2 Sep 2018 at 20:40, Ian Foote wrote: > On 02/09/18 19:59, Shivam

Re: Django bugfix release: 2.1.1

2018-09-02 Thread Adam Johnson
I emailed Paulo off list, he was using Python 3.4 which Django 2.1 no longer supports. pip could give a friendlier message when environment markers don’t match but there are such versions on PyPI. On Sun, 2 Sep 2018 at 08:22, Carlton Gibson wrote: > Hi Paulo > > It looks like there's something

Re: the design of django group permission should be optimized in django.contrib.auth.ModelBackend

2018-09-01 Thread Adam Johnson
Hi damoncheng, Previous to swappable User model, the best practice was to define a secondary model with OneToOneField to User for storing auxiliary information. You could do this for Group to solve your use case now. As for the feature request, I wouldn't be against it, though I'm not really in

Re: New Password Validators

2018-08-31 Thread Adam Johnson
I agree with James, Django core shouldn't include these. If your organization requires you to implement such practices despite their problems, add your own password validators, and maybe distribute them in a third party package! On Fri, 31 Aug 2018 at 06:32, James Bennett wrote: > This type of

Re: Add autocomplete attribute to contrib.auth fields?

2018-08-30 Thread Adam Johnson
I wouldn't think such pentest tools are a major concern, as I'd guess not many users have to meet such requirements, and it would always be possible to subclass the forms and set autocomplete=off where appropriate. Also the referred mdn docs

Re: Django 2.1 released

2018-08-27 Thread Adam Johnson
Please see the contribution guide for information on requesting a feature: https://docs.djangoproject.com/en/2.1/internals/contributing/ On Mon, 27 Aug 2018 at 11:23, wrote: > Cool! Can I custom django.contrib.auth.models.Group like > django.contrib.auth.models.AbstractUser in the further

Re: Deprecate PickleSerializer for session serialization?

2018-08-26 Thread Adam Johnson
 On Sun, 26 Aug 2018 at 20:10, Florian Apolloner wrote: > Yes, lets deprecate and remove it. No 3rd party package from Django > itself, if someone wants it, they should write one. > > On Sunday, August 26, 2018 at 3:57:20 PM UTC+2, Adam Johnson wrote: >> >> +

Re: Feedback wanted for API to support for multi file upload

2018-08-26 Thread Adam Johnson
> > My suggestion would be to add the new keyword argument which enable the > new behavior and keep the attr-thing as is. > I could add a warning if someone uses the "old" style. It is a bit > suggestive though. Whilst it's not the normal way of deprecating things in Django, I'm not against it.

Re: Adjusting Django's security notification policy

2018-08-26 Thread Adam Johnson
> > Members who are known to the security team to be maintaining codebases > on unsupported versions of Django will also be asked to provide > details of how they plan to migrate to a supported version, and to > assess whether they still require full notifiations once that > migration is complete.

Re: Deprecate PickleSerializer for session serialization?

2018-08-26 Thread Adam Johnson
+1 to deprecate. Maybe we deprecate and remove it, and some user makes a third party package if they so wish? On Sun, 26 Aug 2018 at 13:36, James Bennett wrote: > The only use case for pickle that I'm aware of is "I need a way to add a > security hole to my site". So let's just get rid of it. >

Re: Model default modelform

2018-08-20 Thread Adam Johnson
Not sure that's what's being suggested here James? But I'm -1 on this because it's adding more coupling between models and forms. Also Jamesie, can't you just subclass in your ModelAdmin to replace get_form / View classes to replace get_form_class and achieve the same thing? As far as I

Re: Add a setting for customizing the CSRF token name?

2018-08-18 Thread Adam Johnson
I've thought about this a bit, especially back in the context of tracking how many sites use Django. Besides the CSRF token input name there are probably tens to hundreds of little signals that a site runs Django, e.g. the presence of /admin/, CSRF/session cookie presence/size, APPEND_SLASH,

Re: HTML5 and XHTML5 documents

2018-08-12 Thread Adam Johnson
You didn't pose an exact question in your message, but I guess it's "Can Django officially support XHTML5?" As it's a stricter subset of HTML5, it seems a valid idea. But at the same time, we need to be able to support it going forwards, with test coverage and knowledge that this is what we aim

Re: beginner online tautorial to get into django frame work

2018-08-04 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. Also the docs start with: https://www.djangoproject.com/start/ On Sat, 4 Aug 2018 at 17:15, Faisal Ali wrote: > i

Re: getting started

2018-07-03 Thread Adam Johnson
Django has a long guide about getting started: https://docs.djangoproject.com/en/dev/internals/contributing/ On Tue, 3 Jul 2018 at 15:09, wrote: > how can i start to contribute ...to open source > > -- > You received this message because you are subscribed to the Google Groups > "Django

Re: Optionally using a custom queryset for Paginator and MultipleObjectMixin (ListView)

2018-06-30 Thread Adam Johnson
> > it takes really long to process by MySQL. > Which version? Subquery performance gets better in MySQL 5.6 and even more so on MariaDB. for count the query would be really simple, and wouldn't need the > prefetches. > When counting, prefetches aren't actaully executed. Check the actual SQL

Re: rlwrap and manage.py dbshell

2018-06-28 Thread Adam Johnson
Won't this do the trick? diff --git a/django/db/backends/oracle/client.py b/django/db/backends/oracle/client.py index 102e77fd15..1a0e1ca10b 100644 --- a/django/db/backends/oracle/client.py +++ b/django/db/backends/oracle/client.py @@ -8,5 +8,5 @@ class DatabaseClient(BaseDatabaseClient):

Re: Cache-control decorator and s-maxage

2018-06-25 Thread Adam Johnson
Seems like a fairly straightforward, inoffensive change to me! Make a ticket and let me know, I'll help review On Fri, 22 Jun 2018 at 18:58, Tomasz Knapik wrote: > Hi everyone, > > I've been wondering what you think about making the cache-control > decorator do the same thing to s-maxage as it

Re: Humanize naturaltime alternative phrasing

2018-06-06 Thread Adam Johnson
Claude, that's a good idea - it increases the future options and also doesn't require a lot of translation work up in Django core up front. On Sun, 3 Jun 2018 at 09:39, Claude Paroz wrote: > I think I'd rather do some refactoring so that creating its own filter > with custom strings is easier.

Re: Humanize naturaltime alternative phrasing

2018-06-02 Thread Adam Johnson
Hi Gregory, I'm no expert on making changes to filters like this, but do you know what would the impact on translations be? Is there an equivalent alternative phrasing for all languages? FYI the tests are here:

Re: Spaces between argument separator and argument in template filter generate error

2018-05-31 Thread Adam Johnson
I think it's better to be conservative here and leave it as-is, the current syntax has worked for years and this change doesn't really reduce the risk of bugs. On Thu, 31 May 2018 at 03:34, wrote: > In the template filter system now, > > spaces between augment separator and augments generate

Re: Simplify middlewares (again) and get rid of process_view

2018-05-27 Thread Adam Johnson
I'm also in favour of simplifying away process_view . And having worked with a multi-domain site that altered request.urlconf in a middleware, I know the problems it can bring. Carl's point about modifying request.path is interesting - if we're looking to allow modifying it in the resolver step

Re: going through the django tutorial i found error while executing the python manage.py runserver.The error is attached below

2018-05-08 Thread Adam Johnson
For future ref: this mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On 8 May 2018 at 05:57, Pradeep Sharma wrote: > check your models.py >

Re: Design Decision: GFK Reverse Lookups

2018-04-18 Thread Adam Johnson
I agree, adding more functionality to the ORM for this one limited use case doesn't seem worth it, especially given GenericRelation's existence. On 18 April 2018 at 17:10, Tim Graham wrote: > I'd lean toward a wontfix. In particular, making changes in >

Re: Shouldn't manage.py call python3 instead of python?

2018-04-10 Thread Adam Johnson
e if that would work or not) > > On Mon, Apr 9, 2018 at 3:58 PM, Adam Johnson <m...@adamj.eu> wrote: > >> (Or would it work to use os.path.basename(sys.executable) ?) >> >> >> The shebang is interpreted by the OS so this is before python even starts >>

Re: Shouldn't manage.py call python3 instead of python?

2018-04-09 Thread Adam Johnson
> > (Or would it work to use os.path.basename(sys.executable) ?) The shebang is interpreted by the OS so this is before python even starts :) On 9 April 2018 at 20:53, Collin Anderson wrote: > I personally just edit my manage.py to change it from python to python3. >

Re: Improving usefulness of management command help output via reordering options

2018-04-06 Thread Adam Johnson
+1 Seems sensible to me too! Maybe the common arguments can even be put under a header like 'common arguments', if argparse allows that. On 6 April 2018 at 07:31, Carlton Gibson wrote: > Hi David. > > Your suggestion seems sensible, good even. (To me at least. ) > >

Re: Not Found "/lobby/" django-channels routing error

2018-04-04 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On 4 April 2018 at 03:19, Mike Johnson Jr wrote: > *routing.py* > > *from channels

Re: Infinite scrolling, Ajax, Phone or PC?

2018-04-01 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On 1 April 2018 at 15:31, Jamaldin Pro wrote: >Hello. > >How can I make Infinite

Re: A more useful list of common passwords?

2018-03-30 Thread Adam Johnson
This new file sounds good to me. Whilst you're at it, what is the new file size? I downloaded the gist, took only column 3 (the actual passwords) and gzipped it, it came to 81K over the existing 3.8K. Uncompressed that's 163K over 7.1K. It would probably warrant a smarter checking algorithm

Re: Google Summer of Code 2018

2018-03-27 Thread Adam Johnson
I'm afraid this doesn't fit into one of the three Django GSoC categories as listed at https://code.djangoproject.com/wiki/SummerOfCode2018 : >- Work on Django itself - such as the ORM, forms, etc. This is what >we've traditionally accepted GSoC entries in. > > >- Work on tools to

Re: Having ERROR running Django project !!!

2018-03-26 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On 26 March 2018 at 14:27, Jamaldin Pro wrote: > Hello > > I was creating a Djnago project

Re: Gsoc 2018 proposed project

2018-03-26 Thread Adam Johnson
Please don't repost, you already posted this and got a reply in https://groups.google.com/forum/#!topic/django-developers/2aJbPvepHmo On 26 March 2018 at 07:41, AGATEVURE GLORY wrote: > Hello, > > Project Idea: Django Girls Tutorial Glossary documentation and

Re: Problem in makemigration

2018-03-20 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On 20 March 2018 at 13:26, wrote: > Django is unable to detect new changes i have made in

Re: Django communications clent and server

2018-03-04 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On 4 March 2018 at 12:20, Richard Maceček wrote: > Hello, I need help with client and

Re: “Abusing BinaryField” warning about binary files in DB

2018-02-25 Thread Adam Johnson
Did you know Facebook store their assets in MySQL, because it's the fastest replicated super-reliable thing to put them in? https://secure.phabricator.com/book/phabflavor/article/soon_static_resources/ (near the end of 'Caches and Serving Content') I am in favour of weakening the warning On 25

Re: Consider renaming `mark_safe` to `dangerously_trust_html` (etc)

2018-02-22 Thread Adam Johnson
I am also in favour of a rename without deprecating the old name. I like 'trust_html' - it's still similarly short but as Tom says it implies more than 'mark_safe' does. On 22 February 2018 at 08:30, Tom Forbes wrote: > What about just 'trust_html'? The dangerous part is quite

Re: Support for `Q` objects in `get_or_create` and `update_or_create`

2018-02-20 Thread Adam Johnson
I think it's perfectly sane to document the filter + get_or_create combo, feel free to open a ticket and pull request On 20 February 2018 at 20:26, 'Mike Lissner' via Django developers (Contributions to Django itself) wrote: > This is my first message here,

Re: select_related() for fetching individual fields

2018-01-29 Thread Adam Johnson
el, the Queryset works as expected, but > not if it is a primitive field, > > Besides, the syntax proposed by me has no other meaning currently and > follows the overall logic. (In fact, I was expecting that Django does it > the way I describe, because of the aforementioned example).

Re: Behavior of ModelAdmin.fieldsets with 'classes': ('collapse',) when fieldset name is None.

2018-01-29 Thread Adam Johnson
> > * If you agree that it needs to be fixed, just showing the (Show) link, > would suffice? +1 from me, seems like the straightforward solution On 28 January 2018 at 22:45, Douglas Miranda wrote: > Hello, I don't know if this was debated before, but I think the

Re: Bug in utils.encoding producing invalid JSON for request body

2018-01-29 Thread Adam Johnson
e methods. Question for me is how to pass the kwargs in for > json.dumps to allow custom encoders. Or do we not want this (I think we do)? > > On Mon, Jan 29, 2018 at 4:50 PM Adam Johnson <m...@adamj.eu> wrote: > >> the JSON it produces (it does try) >>> >> >>

Re: Bug in utils.encoding producing invalid JSON for request body

2018-01-29 Thread Adam Johnson
> > the JSON it produces (it does try) > I wouldn't say it "tries", it just calls str on any object that is passed in, which for a simple dict with strings in, looks close to JSON. force_bytes definitely shouldn't be trying to JSON-coerce things. Thus I don't think it's a bug. Bugs are when

Re: Ticket #29066

2018-01-28 Thread Adam Johnson
It's generally best to leave questions like this on the PR than in a separate mailing list thread. I'll answer there ( https://github.com/django/django/pull/9627 ). On 27 January 2018 at 07:02, wrote: > Hello everyone ! > > I have two queries with respect to the ticket

Re: Add slicing notation to F expressions

2018-01-28 Thread Adam Johnson
Actually there was some further discussion in https://groups.google.com/forum/#!msg/django-developers/PsHDk1doTDg/CewZdVMJAQAJ where we settled that the slicing operator need not be implemented in the scope of that ticket. On 28 January 2018 at 17:09, wrote: > Hello ! > >

Re: select_related() for fetching individual fields

2018-01-26 Thread Adam Johnson
F.objects.select_related('g__n') looks a bit convoluted to me. You can already do something like F.objects.select_related('g').only('g__n', *[f.name for f in F._meta.get_fields()]) and write a small helper function for the list comprehension to avoid typing. Also I'd say it's generally a rare

Re: Ticket #29015

2018-01-21 Thread Adam Johnson
Please keep the conversation just on the pull request, and don't bug for review after a day. There are many patches to review, and half the work is done by volunteers in their spare time (I am one). Beware that there are 11,195 people subscribed to this mailing list. On 21 January 2018 at 07:56,

Re: PR 9583 - Ticket 28643

2018-01-18 Thread Adam Johnson
+1 for adding Left/Right as plain functions right now. Simon's example for a new future is really nice but outside the scope of the ticket. On 18 January 2018 at 22:30, Josh Smeaton wrote: > I think having Left/Right is the right way to go. If there are > opportunities

Re: Ticket #29015

2018-01-18 Thread Adam Johnson
It's a lot easier to review code changes if you submit a pull request, and you'll get much more attention for a pull request with passing tests than pasting a stack trace to the mailing list. Here's the how-to:

<    4   5   6   7   8   9   10   11   >