Re: Proposal to upgrade django.core.mail to Python's modern email API

2024-07-21 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I wish this discussion was on the forum so I could mark Pankaj’s response as spam  On Sun, 21 Jul 2024, at 08:26, Othniel Davidson wrote: > Thank you for the update > > On Sat, Jul 20, 2024 at 15:26 Pankaj Kumar wrote: >> Hi Sir, >>I hope this message finds you well. >> I am writing

Re: Proposal to upgrade django.core.mail to Python's modern email API

2024-06-25 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
After my comment in the steering council vote and in-person conversation with Jake, I believe the SMTP backend will not be implemented for DEP 14 : https://forum.djangoproject.com/t/steering-council-vote-on-background-tasks-dep-14/31131/20 On Tue, 25 Jun 2024, at 10:27, Arthur Pemberton wrote:

Re: Should Django use Ada?

2024-04-02 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I agree with Jörg. We need evidence of problems before we decide to act, and that those problems aren’t being addressed in Python. Forcing a new dependency on all users is not something we’d do lightly. On the contradictory standards, see the cURL maintainer’s post:

Re: Use of TIME_INPUT_FORMATS in TimeField

2024-03-05 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
USE_I18N does not disable localization, but internationalization. USE_L10N was the setting to enable/disable localization, but it was deprecated in Django 4.0: https://docs.djangoproject.com/en/4.0/releases/4.0/#localization . It was removed completely in Django 5.0, in this commit:

Re: Proposal for SyncChatRoom Integration in Django

2024-02-13 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Hi David SyncChatRoom sounds more like something that Django would help users build, rather than include in the framework. If it’s somewhat reusable between projects, it would be best be published as a third-party package. Thanks, Adam On Tue, Feb 13, 2024, at 8:57 PM, David Ansa wrote: >

Re: New feature request - Run only a random subset of tests.

2024-02-12 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I’d be against this. I think this approach would be counterproductive in most cases due to the high probability of a false positive. Including it as a core feature is not necessary when it can be added through a third party package. On Mon, Feb 12, 2024, at 2:22 PM, אורי wrote: > Hi, > > Also,

Re: Testing Unmanaged Models - Using the SchemaEditor to create db tables

2024-02-09 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Hi Emmanuel Most activity from this mailing list has moved to Django Internals category on the forum: https://forum.djangoproject.com/c/internals/5 . Better to post there in future, or you could even duplicate this post. I think your approach is worth sharing in a blog post, or even a package,

Re: Question about support dates

2023-10-25 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
As the maintainer of several Django-related packages and a contributor to many more, I see the policy as fair. Most maintainers have little capacity, and anything to reduce that burden is welcome. Third-party packages typically test with a matrix of Python versions against Django versions.

Re: HELP needed in a Reactjs Django project

2023-10-13 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
es it easy for them to answer. Thanks for your understanding and all the best, Adam On Thu, Oct 12, 2023, at 8:03 AM, Plamedi klj wrote: > Bien > > Le ven. 13 oct. 2023 à 14:14, Tejas Vaij a écrit : >> I am trying to upload a blob from a service-worker in react-js to a django >

Re: Pertaining the 4.2.6 release's "recreate indexes" footnote

2023-10-12 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I’ve created a PR with a suggested improvement: https://github.com/django/django/pull/17359 . On Thu, Oct 12, 2023, at 5:09 AM, Mariusz Felisiak wrote: > > Thoughts on this? > > Documentation improvements are always welcome, you can send your proposition > via GitHub PR. > > Best, > Mariusz >

Re: Link to alternative Python resource

2023-10-09 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I think it would be better to remove the link from the contribution guide, since it’s quite advanced. The recommendation for the tutorial and “you should have a good understanding of Python itself” seem sufficient to me. I noticed we have other “Dive Into Python” links throughout the docs.

Re: Looking for a code that separates fields while applying migrations

2023-10-02 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
See alte_field in the schema editor: https://github.com/django/django/blob/f4e72e6523e6968d9628dfbff914ab57dbf19e6b/django/db/backends/base/schema.py#L811 It steps through what has changed in the field and generates SQL for the database relevant changes, queueing up statements with

Re: Sync and Async versions of the same function: guidelines for contributors

2023-08-16 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I think some duplication will always be required, unfortunately. Bridging the two paradigms is necessarily costly as it involve communicating between threads. IMO duplication is worth it to avoid performance regressions for sync code, and to make async code worth using. I am doubtful there is a

Re: How to get started with contributions

2023-08-15 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
/intro/contributing/ . If you get stuck or have questions, post back here or in the “Mentorship” section on the forum: https://forum.djangoproject.com/c/internals/mentorship/10 Hope that helps, Adam On Sat, Aug 12, 2023 at 1:35 PM nikita bansal wrote: > Respected Sir/Mam, > >

Re: Disabling dark / light mode UI toggle

2023-08-10 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
9 August 2023, Niccolò Mineo wrote: >> >>> Yes, not pretty, though, right? >>> >>> Il giorno martedì 8 agosto 2023 alle 07:33:12 UTC+2 Adam Johnson ha >>> scritto: >>> >>>> You should be able to disable the button by creating an empty >&

Re: Disabling dark / light mode UI toggle

2023-08-07 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
You should be able to disable the button by creating an empty admin/color_theme_toggle.html template in your project. On Mon, Aug 7, 2023 at 10:28 PM Niccolò Mineo wrote: > * I haven't found a convenient way, that is. > > Il giorno lunedì 7 agosto 2023 alle 23:26:11 UTC+2 Niccolò Mineo ha >

Re: Adding "reason" to django.shortcuts.redirect

2023-08-07 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
This sounds reasonable, but unfortunately, it's backwards incompatible and so we cannot make the change. Any URL with a “reason” URL parameter would no longer be resolvable. You can make a project-specific shortcut function that allows providing the reason parameter. Since it’s two lines long,

Re: Ticket #34555 ModelBase prevents addition of model Fields via __init_subclass__

2023-07-24 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
cs/ref/models/class.txt > - https://github.com/django/django/blob/main/docs/topics/db/models.txt - > perhaps within a new subheading in the Model inheritance section? > > Once confirmed I'll amend the PR > > Thanks > > > On Wed, 28 Jun 2023 at 10:28, 'Adam Johnson' via Dj

Re: Password reset link is not displayed by default

2023-07-24 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
to answer. That said, in response to your question: Django's default admin setup does not come with a password reset view. It only has a "change password" view for logged in users. If you want to support not-logged-in users to reset their passwords, you need to add a URL as you have

Re: Ticket #34555 ModelBase prevents addition of model Fields via __init_subclass__

2023-06-28 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
ectations could be done by moving most of the >> ModelBase.__new__ logic to Model.__init_subclass__ but this would require a >> massive re-enginering of meta programming logic that is remain unchanged >> for years. >> >> Le vendredi 12 mai 2023 à 09:38:04 UTC-4,

Re: Deploying Django under a sub-path

2023-06-23 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
to the information you found. Thanks, Adam On Fri, Jun 16, 2023 at 10:23 PM Arthur Pemberton wrote: > I found https://code.djangoproject.com/ticket/7930 seems like > `FORCE_SCRIPT_NAME` just isn't meant to work. > > Maybe the docs should reflect that. > > Arthur Pemberton > > On F

Re: why this type error showing in my payment mode

2023-06-12 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
y for them to answer. Thanks for your understanding and all the best, Adam On Sat, Jun 10, 2023 at 11:37 AM Atul Tiwari wrote: > solve this > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)

Re: Conclusion of ticket #26761

2023-05-12 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I have replied on the ticket with an example using arbitrary HTML as required. On Wed, May 10, 2023 at 10:30 AM Carsten Fuchs wrote: > Hello, > > ticket #26761 was closed as wontfix, however I don't understand the reason. > https://code.djangoproject.com/ticket/26761#comment:19 > > The ticket's

Re: Ticket #34555 ModelBase prevents addition of model Fields via __init_subclass__

2023-05-12 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
+1 from me. As Simon covered on the ticket, the change is small. Making Django classes support __init_subclass__ might unlock some nice dynamic field patterns. On Thu, May 11, 2023 at 12:47 PM hottwaj wrote: > Hi there, I opened the above ticket and submitted a PR with fix and test > added. I

Re: Deprecate CICharField, CIEmailField, CITextField

2023-05-12 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
cts, as I have to come up with > some generic solution to something that was not broken before this feature > deprecation (and the docs does not mention this case). > Good that Adam covered it in the article, but I feel that this could be > handled on a lower level than right now. Cur

Re: Production Django use and "real ip"

2023-04-20 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
u wish to ignore etc. They also >> have a handy notice/disclaimer >> <https://github.com/un33k/django-ipware/blob/master/README.md#Notice> on >> the subject. >> >> IMO Django core should leave this 3rd party packages and individual >> deployment

Re: Proposal: Constructing urls outside the request cycle

2023-04-16 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
A setting isn't so mad. Many Django projects I've seen use a similar custom setting for constructing URLs outside of requests. One question though, how will we support projects that are served at multiple domains? Would Django only support the "main" site through BASE_URL and require you to

Re: Deprecate CICharField, CIEmailField, CITextField

2023-04-14 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Just to note, for anyone that finds it useful, that I wrote a blog post on migrating to collations: https://adamj.eu/tech/2023/02/23/migrate-django-postgresql-ci-fields-case-insensitive-collation/ But yes, I have also been thinking like Tom that indexing UPPER("email") seems to be the path of

Re: Production Django use and "real ip"

2023-04-14 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
It's surprisingly complex to interpret x-forwarded-for: https://www.brainonfire.net/blog/2022/03/04/understanding-using-xff/ . We will never be able to safely add automated handling. I *guess* we could add a note to the deployment guide like "check your HTTP_X_FORWARDED_FOR setting". I'm

Re: Django "makemigrations -- update" donot working

2023-04-11 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Indeed, David is right. The --update flag is intended for developing a feature branch and adding extra changes to a work-in-progress migration. This is why it requires the migration to not be applied. On Sun, Apr 9, 2023 at 9:20 PM David Wobrock wrote: > Hi, > > As you can see, the error

Re: Fellow Reports - April 2023

2023-04-11 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Welcome Natalia  On Tue, Apr 11, 2023 at 2:52 PM Natalia Bidart wrote: > Week ending April 9, 2023 > > Hello! I'm Natalia (AKA nessita), the new Django Fellow. I officially > started on April 1st (really :-)) though I had a slow start since I had a > long-time planned vacation. > > So far I

Re: Implement Ruff Linter

2023-04-06 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I don't think we should adopt Ruff. It's a new, somewhat experimental project. It wouldn't provide any gains except speed, but that is not really a concern since it still takes a handful of seconds to lint Django with Flake8 and co. On Mon, Apr 3, 2023 at 1:59 PM Jerome Obi wrote: > Hi ! > I

Re: Stalebot on djangoproject.com issues

2023-04-06 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I agree that we should remove Stalebot. Closing old issues doesn't fix them or provide a reason why they aren’t going to be worked on. On Thu, Apr 6, 2023 at 8:02 AM Sarah Boyce wrote: > From what it sounds, I guess the main value was prompting a one time > spring clean. As there are not that

Re: Proposal: Check constraints at the model field level

2023-04-05 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Mariusz, I agree with the burden, but it should be noted that SQL has both CHECK on the field and table level, and CheckConstraint only defines table-level constraints. This is not true for unique constraints or indices. Also, what do you think of a way for custom field classes to add

Re: Proposal: Check constraints at the model field level

2023-04-05 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I agree this feature would be useful, at least to allow bundling check constraints with custom field classes. As you point out the PositiveIntegerField classes do this within Django, and doubtless many custom fields have used the db_check() method. The only thing I'm not a fan of in your proposal

Re: Exporting some of the `datetime` functions from `django.utils.timezone`

2023-03-20 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I agree with Mariusz. Encouraging alternative import paths for standard library functions can only lead to confusing code. On Mon, Mar 20, 2023 at 11:47 AM Mariusz Felisiak < felisiak.mari...@gmail.com> wrote: > > I find it confusing that we have to import now from django.utils.timezone, > but

Re: Add a minimal Gitignore

2023-03-10 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I'm also against the idea, unless done in a very minimal fashion. Many tools in the ecosystem put "ignore everything here" .gitignore files into their not-normally-committed directories: at least Coverage.py, Mypy, pytest, and virtualenv. So the trend is that less and less .gitignore patterns are

Re: Add a minimal Gitignore

2023-03-09 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
The Django project has a .gitignore file: https://github.com/django/django/blob/main/.gitignore On Thu, Mar 9, 2023 at 3:46 PM Daniel Azubuine wrote: > I think it will be a little bit helpful to add a very minimal .gitignore > file to the django project. > Maybe one that just ignores the

Re: Need guidance for my first Open Source Contribution

2023-03-07 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
/intro/contributing/ . If you get stuck or have questions, post back here or in the “Mentorship” section on the forum: https://forum.djangoproject.com/c/internals/mentorship/10 Hope that helps, Adam On Tue, Mar 7, 2023 at 6:13 AM 'WASIF AHMED M' via Django developers (Contributions to Django

Re: Proposal: Extend db.models.functions.datetime.Now

2023-02-28 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Hi Matteo, I agree with Mariusz on the ticket - this is a step beyond what Django should support. You've shown in your proposal that such a function takes 3 lines of code for PostgreSQL. I don't think this is a burden on developers to implement when needed. Also, the TruncDate(Now()) pattern is

Re: Model icons

2023-02-18 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Putting HTML for the admin in model definitions is a bit too coupled. I think you may be able to add icons already by overriding the admin template - can you try playing around with that? On Mon, Feb 6, 2023 at 12:07 AM Yeonggwang Yang wrote: > that sounds good with me > > 2023년 2월 5일 일요일 오전

Re: I would like to participate and contribute in your project

2023-02-15 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
/stable/intro/contributing/ . If you get stuck or have questions, post back here or in the “Mentorship” section on the forum: https://forum.djangoproject.com/c/internals/mentorship/10 Hope that helps, Adam On Sun, Feb 12, 2023 at 10:15 PM Esteem Learning Centre, Abuja < ahmeddauda

Re:

2023-02-15 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Please don’t email random code snippets to this list. On Mon, Feb 13, 2023 at 3:29 PM Thomas Ménès wrote: > def extra_permissions(permission_classes): > """Decorate a CBV method to add specific permissions on the instance.""" > def decorator(func): > def decorated_func(self, *args, **kwargs): >

Re: Customizing authentication e autorization, with constant for models names User, Permission, Group, PermissionMixin and constant for field names and table name

2023-02-15 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
a different database table name for Group, I’d say that would be grounds to implement your own Group model - which really isn’t much code. Thanks, Adam -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)&q

Re: Multiple instances of DjangoAdmin share the same model LogEntry

2023-01-27 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I'm also skeptical we need to support this use case. Certainly some users prefer *shared* log messages, so all actions are shown regardless of which interface was used. Just to comment on the DB side: storing the same few names over and over in such a column would be a waste of disk space. It

Re: X-Forwarded-Prefix

2023-01-25 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
In a brief search, I could not find any docs for X-Forwarded-Prefix. MDN documents X-Forwarded-For and others: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For To customize those functions, you could use a middleware to modify requests to wrap them: class

Re: Proposal for an "Age" PostgreSQL ORM function

2023-01-21 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
+1 to what Carlton said. You can make this function in your project like so: class Age(Func): function = "AGE" A Django wrapper would actually be more complicated. You’d need to understand both the PostgreSQL and Django function docs, and you might not be sure Django does anything special

Re: New contributor

2023-01-21 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
/intro/contributing/ . If you get stuck or have questions, post back here or in the “Mentorship” section on the forum: https://forum.djangoproject.com/c/internals/mentorship/10 Hope that helps, Adam On Fri, Jan 20, 2023 at 10:26 PM Muhammad Hassan wrote: > Hi Every One, > I want to cont

Re: Subparsers for management commands

2023-01-15 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Thanks, Adam On Wed, Jan 11, 2023 at 2:02 AM Mark Gregson wrote: > I was just looking at custom management commands (Django 3.2) and noted > that the error handling for a subparser didn't match the Django behaviour > without some extra, undocumented work. > > If my Command subc

Re: Django accounting software.

2023-01-15 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
y for them to answer. Thanks for your understanding and all the best, Adam On Thu, Jan 12, 2023 at 8:07 PM KEMAL TK. wrote: > It will be used to track customer, inventory, financial affairs. > > Django accounting software. > There are examples on githup. > perfexcrm this appl

Re: Django t-shirt

2023-01-15 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
There is a Django Threadless store where you can buy T-Shirts and other merchandise, which all supports the DSF: https://django.threadless.com/ It’s linked from the fundraising page: https://www.djangoproject.com/fundraising/ I have a Django phone case from there! On Fri, Jan 13, 2023 at 11:44

Re: get_manager short ut function proposal

2022-12-31 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Your proposal is quite niche: it only shortens the creation of a Manager class when you need to add a single filter() call. The function seems like it might be a useful helper within a project, if you use many such managers. But custom managers might use any queryset methods, or other logic. I've

Re: Backport for ticket 34063?

2022-12-31 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
This thread got too long too fast: it's a hell of a lot to catch up on. In the future, please can we all let things sit for a bit so other voices can chime in, especially when the issue has concretely affected very few users. In the past I have also been frustrated at particular bug fixes not

Re: Updating profile image in django

2022-12-29 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
y for them to answer. Thanks for your understanding and all the best, Adam On Mon, Dec 26, 2022 at 4:32 PM Nsikan Patrick wrote: > Hello everyone, so I have I have this issue when trying to update a > profile photo in django. > The Profile photo actually updates if I upload an image. Bu

Re: django squashmigrations creating incorrect code?

2022-12-26 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Yes, a single line message warning that the migration needs some edits would be nice. On Fri, Dec 23, 2022 at 11:18 AM Christian González < christian.gonza...@nerdocs.at> wrote: > HM wouldn't it be better to add a stdout message after completing the > squash? Because if the cmd doesn't say

Re: Make Cookies in Django follow the RFC correctly

2022-12-06 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
> To continue the discussion I think we’ll need to hear about such a *strong reason* to break compatibility, or a path forward that is not backwards incompatible. Thanks, Adam On Mon, Dec 5, 2022 at 3:19 AM Fernando Karchiloff < ferna...@ferkarchiloff.dev> wrote: > Currently the implementatio

Re: Set a reasonable default for EMAIL_TIMEOUT

2022-11-29 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Federico - I think we’d like to see a few more “pro”s in the thread. Personally, I am pro adding a default timeout. The lack of a default timeout in *requests* is a constant source of outages, which lead me to write this hack

Re: Can we move the activity on this list to the Forum now?

2022-11-28 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Big +1 from me, I love the forum. It’s a lot more discoverable and powerful. On Mon, 28 Nov 2022 at 15:22, 'Tobias McNulty' via Django developers (Contributions to Django itself) wrote: > As someone who only just joined the forum -- I'm +1: > >- The forum has seen great adoption from what I

Re: rename internal SetPasswordForm.user into "instance" - or add it

2022-11-28 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I don’t think it’s worth adding support for “instance”. The name “instance” is used in generic mode view classes because they work with any kind of object. Since the password change view knows it has a user, it can use the more specific variable name. You can add an “instance” property in your

Re: Potential way forward for DATABASE_URL

2022-11-28 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I’m happy with this approach, it’s a little step forwards towards maintainable settings files. On Sun, 27 Nov 2022 at 20:37, 'Tobias McNulty' via Django developers (Contributions to Django itself) wrote: > Hi Raphael, > > Thanks for taking this on. > > Starting with a limited scope seems like a

Re: [Technical Board?] Project Ideas, and beginning GSoC 2023.

2022-11-28 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I am not sure the db level defaults PR is suitable for a GSoC project at this point - it’s pretty well developed. I think it could do with some review and testing form those who are interested. On Mon, 28 Nov 2022 at 17:10, 'st...@jigsawtech.co.uk' via Django developers (Contributions to Django

Re: Technical Board vote on DEP 0012: The Steering Council

2022-11-28 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
+1 from me And +1 to using the forum in future On Tue, 29 Nov 2022 at 00:23, charettes wrote: > +1 from me as well. > > Le lundi 28 novembre 2022 à 08:32:01 UTC-5, carlton...@gmail.com a écrit : > >> Hi All. >> >> Tom Forbes is currently unable to post to the Google Group here, due to >>

Re: Calling save_m2m() in UserCreationForm.save()

2022-11-27 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Your proposal seems reasonable - if actually saving, we should save the m2m fields too. I think the best next step would be to file a ticket and work on a PR. The first step would be to add a test case reproducing the issue. On Wed, Nov 23, 2022 at 4:59 PM Mark Gensler wrote: > Hello all! > >

Re: Using comment in Django

2022-11-26 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
y for them to answer. Thanks for your understanding and all the best, Adam On Sat, Nov 26, 2022 at 10:55 AM Tawfeeq Zaghlool < tawfeeq.zaghl...@gmail.com> wrote: > I have two models Profile and Post; I want to allow the user to add > comments on any of them without repeating the

Re: [Technical Board?] Project Ideas, and beginning GSoC 2023.

2022-11-25 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Four ideas from myself: 1. CORS in core django-cors-headers’ implementation is a bit janky, for example it uses a regex to filter paths. It also lacks the key ability to set up different CORS policies per path. Both of these could be done with a decorator. I’d like to see a form of CORS support

Re: ModelForm fields localization

2022-11-17 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Christian - did you end up making a docs PR here? I’m afraid I don’t really know why fields aren’t localized by default. If you have a proposal to change this in a backwards-compatible, low disruption way, that could be easier to discuss. On Mon, Sep 5, 2022 at 9:23 PM Christian González <

Re: Suggestion: Limit activated languages to settings.LANGUAGES

2022-11-17 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I do like this suggestion. I also find the current behaviour surprising. Do you have a plan for implementation? I guess this would have to go through the regular deprecation pathway? ‪On Tue, Oct 4, 2022 at 4:32 PM ‫אורי‬‎ wrote:‬ > Hi Shai, > > Actually, I think this issue is very similar to

Re: Advancing the "content negotiation" and "modernising request object" proposals.

2022-11-12 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
ld have a slight preference for raising an > UnsupportedMediaType as well and letting that percolate to a 415 as it > seems more correct from a content negotiation perspective. > > Le vendredi 11 novembre 2022 à 11:22:44 UTC-5, Adam Johnson a écrit : > >> This first-step solution is good with

Re: Advancing the "content negotiation" and "modernising request object" proposals.

2022-11-11 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
ould be a review of serialization >> and forms, in light of developments such as Pydantic, attrs/cattrs, and >> django-readers, but that is **not** on topic here.) This was first >> suggested in 2011, but has made little progress in that time. [0][1] >> >> [0

Re: Static files is not loading while deploying the project to AWS ec2

2022-11-05 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
django-developers is not a support channel. Email support requests to *only* django-users. On Sat, Nov 5, 2022 at 7:34 AM Nishant Sagar wrote: > Hi all, > > I deployed the django project to AWS ec2 instance using nginx and gunicorn > but the static file is not loading at all. > > Can someone

Re: custom validation error in password_validators

2022-11-02 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
> > But it is not possible unless we directly override the > password_validation classes and this is an extra and dirty work. I don't think this work is dirty! We generally prefer to avoid extra settings (and sub-settings) where possible. The settings file should be clear, and not do what code

Re: Proposal: filter by multiple values, case-insensitive

2022-11-02 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
This can currently be achieved with: qs.annotate(lowername=Lower("name")).filter(lowername__in=['text']) You’re free to add “iin” to your projects, but I'm not sure it's valuable enough to add to Django. Some years ago, there was an idea to allow python expressions to generate ORM filters, that

Re: How reload django settings on run RestService

2022-10-31 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
y for them to answer. Thanks for your understanding and all the best, Adam On Mon, Oct 31, 2022 at 1:16 PM Lakhvinder Singh wrote: > i try it > > https://github.com/sunscrapers/djoser/blob/master/djoser/conf.py > > user->settings.py use for settings load on global > >

Re: Warning in documentation about filtering queryset in ClassBasedViews

2022-10-29 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I'm inclined to agree with David here. This is a “understanding Python” thing. We can’t feasibly add documentation warnings everywhere such a mistake could be made. On Sat, Oct 29, 2022 at 8:00 PM David Sanders wrote: > Hi Daniel, > > I don't think a warning is necessary here as it's fairly

Re: Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-10-29 Thread Adam Taylor
to True then it can use the logic I included in this comment <https://code.djangoproject.com/ticket/34035#comment:2>. No need for extra database fields. On Wednesday, September 28, 2022 at 7:32:23 AM UTC-6 shang.xia...@gmail.com wrote: > Hi Adam, > > Sorry to clarify I was referrin

Re: Intention behind `adelete` being a queryset method, and not available on a model instance?

2022-10-21 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
. This is because the database libraries Django supports don't have async interfaces. On Fri, Oct 21, 2022 at 4:49 PM Adam Johnson wrote: > If you have a suggestion, sure. But from my perspective the docs are > clear. There's an adelete() method doc'd for QuerySet, and not for Model, > and the rel

Re: Intention behind `adelete` being a queryset method, and not available on a model instance?

2022-10-21 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
erface...”. On Fri, Oct 21, 2022 at 3:51 PM Jason Johns wrote: > gotcha, then perhaps a documentation tweak would be in order, on both > queryset and model pages? because as is, its unclear this is expected. > > On Friday, October 21, 2022 at 9:57:33 AM UTC-4

Re: Intention behind `adelete` being a queryset method, and not available on a model instance?

2022-10-21 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
This is intentional, as it stands. Django 4.1 only added async QuerySet methods, not async Model methods. Async model methods like adelete(), and perhaps asave(), would be the next logical step. On Fri, Oct 21, 2022 at 1:47 PM Jason Johns wrote: > I came across a reddit post yesterday >

Re: Proposal: Add An in-memory data storage backend in Django

2022-10-20 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
+1 from me. Using in-memory storage is great for tests. On Thu, Oct 20, 2022 at 6:30 PM Paolo Melchiorre (paulox) < pa...@melchiorre.org> wrote: > Hi all, > > there is a package that provide in-memory data storage backend, but it's > now abandoned. > > Having support for in-memory data storage

Re: Proposal: Clarify the ENV var that controls the autoreloader so AppConfig's ready() can be have a guard.

2022-10-18 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
://adamj.eu/tech/2020/05/14/how-to-check-the-running-django-command/ ). If it’s runserver, and the env var isn’t set, then you can tell. Thanks, Adam On Sat, Oct 15, 2022 at 4:09 AM Steffan Pease wrote: > AppConfig's ready() function gets called multiple times on manage.py > runserver an

Re: Why using django.contrib.sessions as the salt to encode session data? why not secret key?

2022-10-12 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
ion of the session value is the encoded value, base64 > encoded, and potentially compressed. > The second section is the encoded timestamp, used to determine if it was > created too long ago on decode > The third section is the HMAC signature, base64 enc

Re: ArrayField: Bug on exact_nested_null

2022-10-10 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Ah sorry didn't realize. I would just link to the test from your ticket for now, the fellows are probably in a better position to determine how to treat this bug. On Mon, Oct 10, 2022 at 8:47 AM Ion Alberdi wrote: > Great, thanks Adam! FYI the test is already on django's Test suite >

Re: ArrayField: Bug on exact_nested_null

2022-10-10 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Yes please create a ticket. If you’re feeling brave, try to adapt your test into Django’s test suite (here: https://github.com/django/django/blob/84206607d6bfd61e7f7a88b51163ffd4153e3b5a/tests/postgres_tests/test_array.py#L212 )! On Sun, Oct 9, 2022 at 11:49 AM Ion Alberdi wrote: > Hello to

Re: Why using django.contrib.sessions as the salt to encode session data? why not secret key?

2022-10-05 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Looking through blame, it looks like this hardcoded salt was added in 2010: https://github.com/django/django/commit/45c7f427ce830dd1b2f636fb9c244fda9201cadb#diff-3a6c11bbe36a0e6927f71ad8d669f0021897ba73768ee41073a318a12e11c3d1L85-L90 This actually changed from using the secret key as the salt, to

Re: Optional URL parameters in django.urls.path

2022-10-03 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I'd also be -1. There are two good alternatives already, which are both more flexible. No need to add a third way. On Sun, Oct 2, 2022 at 8:35 AM Carlton Gibson wrote: > Hi. > > Re-reading again, I'm still not sure (personally) of the need/motivation > given either of the "use two entries" or

Re: Revisiting multiline template tags in Django Templates (again)

2022-09-28 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Big +1. IMO tags should work like HTML tags, which can be spread across multiple lines, as often done with multiple attributes. Also, Jinja does it. If you're going to write a DEP, I'd say don't make it too long. The feature is clear enough. The old PR

Re: Regarding Django forms

2022-09-27 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
re willing to support you, and to ask your question in a way that makes it easy for them to answer. Thanks for your understanding and all the best, Adam On Fri, Sep 23, 2022 at 5:31 PM Kiet Lam wrote: > Why don't you also use the context and pass in an array to be rendered at > the htm? &

Re: Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-09-27 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
To have extra properties, we'd need to add extra database fields. It would be somewhat wasteful to add them to all ImageFields when few users will care about the difference. On Mon, Sep 26, 2022 at 10:28 AM David Sanders wrote: > Actually might as well throw out one idea, feel free to discard:

Re: Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-09-26 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
/docs/Web/CSS/image-orientation . (FYI, link to MDN in future, it's a more neutral/universal source than Chrome docs. MDN shows compat in all browsers, and Chrome implements a lot of unique features). On Sat, Sep 24, 2022 at 5:51 PM Adam Taylor wrote: > Following the advice of David Sand

Proposal: Make it so when getting an image's dimensions, EXIF orientation is considered

2022-09-24 Thread Adam Taylor
Following the advice of David Sanders and Mariusz Felisiak, I'm coming here with my proposal rather than continuing on with the ticket system (see ticket #34035 ). I understand the reluctance to make this change. However, things change with web

Re: Django timing

2022-09-09 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
y for them to answer. Thanks for your understanding and all the best, Adam On Fri, Sep 9, 2022 at 2:48 PM Bhuvnesh Sharma wrote: > Hi, > if you are using templates then you can simply write: > > {{message.created|timesince}} ago > > where created is a field of message st

Re: Lookups

2022-09-09 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
y for them to answer. Thanks for your understanding and all the best, Adam On Thu, Sep 8, 2022 at 3:15 PM Bhuvnesh Sharma wrote: > Can anyone explain me the difference between lookups and related lookups? > > -- > You received this message because you are subscribed to the Google Group

Re: Add support for IDNA 2008

2022-09-01 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Some data... The idna package has ~9M downloads a day ( https://pypistats.org/packages/idna ) compared with Django's ~350k ( https://pypistats.org/packages/django ). However it has 191 GitHub stars ( https://github.com/kjd/idna ) compared to Django's 66k ( https://github.com/django/django ). I

Re: A generic cache decorator around low level cache api

2022-08-26 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I'm not sure I quite understand your proposal. Are you suggesting a decorator that caches the results of every queryset that is resolved within the decorated function? If so, I'm not sure how useful it would be. First, if a single query is problematic, there’s normally a way to optimize it within

Re: Change `to_python` and `to_url` to be class methods on path converters

2022-08-25 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I can see the appeal of allowing you to have fewer classes, but I don't think that's a good thing in itself. Keeping responsibilities separate ("convert slugs to/from URL's" versus "be a slug") is a generally desirable property. This change would also complicate the URL parsing process: it would

Re: Named Groups for Enumeration Types

2022-08-24 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
[VHS_TAPE, DVD], "Unknown": [UNKNOWN] } Relatedly, there is pre-pandemic ticket and PR to support dictionaries in Field.choices: https://github.com/django/django/pull/12449 . It could make sense to look at that first, if you'd like to. Enumeration type grouping is kinda ortho

Re: Feature Request: get_default_backend() in django.template.Engine

2022-08-23 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Improving the docs sounds good. I think it would also be worth renaming engines to backends, and EngineHandler to BackendHandler, or similar. Yes it would require a deprecation cycle, but I also imagine 99% of projects would be unaffected. On Tue, Aug 23, 2022 at 8:39 PM Peter Thomassen wrote:

Re: transaction.on_commit() proposal

2022-08-22 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
g 2022 at 14:11, 'Adam Johnson' via Django developers > (Contributions to Django itself) > wrote: > >> Hi >> >> I just wrote a blog post on a late-binding bug that can occur with using >> transaction.on_commit() with a function or lambda within a loop. THe post

transaction.on_commit() proposal

2022-08-22 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
h, and there doesn't seem to be any reason to add further arguments. Users who need to pass a kwarg called 'using' could always construct a partial() themselves. Thoughts? Adam -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions

Re: Allow for strict mode in templates

2022-08-21 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Django logs warnings for missing variables. I believe this logging was added since that ticket was closed. I recently wrote a blog post with some techniques you can use to hook into this logging and turn those errors into exceptions:

  1   2   3   4   5   6   7   8   9   10   >