RE: Intermittent IntegrityError on Model Save with auto_now and auto_now_add Fields

2024-03-18 Thread 'Matthew Pava' via Django developers (Contributions to Django itself)
Hi Bill, We ended up using a package called Django-audit-log: https://pypi.org/project/django-audit-log/. It’s outdated now, but we used the source code for their CreatingUserField, LastUserField, CreationDateTimeField, and ModificationDateTimeField. More modern packages may have enhanced

RE: Allow applications to register links in the admin interface

2023-09-07 Thread Matthew Pava
I reviewed some of the history of this ticket. I tend to agree with the criticisms of adding something akin to an AdminURL to the Django admin. However, the idea of custom views to apps in the admin is an idea that I find appealing. The history of this ticket features a comment from Tim Graham

RE: Feature request: making gettext more robust

2023-06-16 Thread Matthew Pava
I personally like the current behavior. If I don't have a translation prepared for a certain text, I want it to fall back on the default text. Saying that, how about Django incorporate a management command of some sort that can be used to examine the translation files and return the texts that

RE: Django's automatic admin interface.

2023-04-19 Thread Matthew Pava
I agree with your sentiment, Tom. I would add that we could get a more “SPA-feel” by using HTML over the wire or htmx, which requires minimal JavaScript. From: django-developers@googlegroups.com On Behalf Of Tom Carrick Sent: Wednesday, April 19, 2023 5:07 AM To:

RE: Backport for ticket 34063?

2022-12-31 Thread Matthew Pava
Happy New Year! I've been reading this thread with keen interest since James first brought it up. I think James's rationale is on point and that the back port to fix the bug needs to be done. To the future of async, Matthew -Original Message- From: django-developers@googlegroups.com

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

2022-11-16 Thread Matthew Pava
I’m not on the technical board or of any important part of the Django ecosystem at all, but I do have an idea. It would be nice to revamp the “name” field in the default user model, perhaps to have one field for the name as suggested here from the W3C:

URLField Validation

2022-09-23 Thread Matthew Pava
Hello, I ran into an issue with a models.URLField because it limits the size of the field to 200 characters. I find this too short to my use case. I have a valid URL to an external website (in academia), and it won't fit in the Django URLField. This took me down a rabbit hole and this very

RE: Optional URL parameters in django.urls.path

2022-09-19 Thread Matthew Pava
I wonder if maybe you should look at the APPEND_SLASH setting. https://docs.djangoproject.com/en/4.1/ref/settings/#append-slash From: django-developers@googlegroups.com On Behalf Of Meiyer Sent: Monday, September 19, 2022 8:59 AM To: Django developers (Contributions to Django itself)

RE: Postgresql Sequence update on data migration

2022-05-25 Thread Matthew Pava
Please see: https://docs.djangoproject.com/en/dev/ref/django-admin/#sqlsequencereset Also, this question is more for the Django Users mailing list than the Django Developers mailing list. From: django-developers@googlegroups.com On Behalf Of mohamad ali mehdizadeh Sent: Wednesday, May 25,

RE: Adding generated common table expressions

2022-05-10 Thread Matthew Pava
I will always suggest that we use the Subquery API to make CTEs. To make them recursive, just add a keyword argument (recursive=True) and/or use a union. It’s been a while since I looked at CTEs, so I might be missing something. I would hate to see us create an entirely separate API for CTEs.

RE: Revisiting MSSQL and Azure SQL Support in Django

2022-04-01 Thread Matthew Pava
I agree with Tim’s sentiment here. Had a solid SQL Server backend been available 7 or 8 years ago, I would probably have used that due to the requirements from my supervisor. I had to convince him that PostgreSQL would be just as good. Based on what I read on the Git page, though, the backend

RE: Adding Support for DB Views

2022-02-21 Thread Matthew Pava
Currently, I just use the migrations to do a RunSQL and then I make a model with the Meta option managed set appropriately. It works for me, but perhaps something a bit more convenient is in order these days. From: django-developers@googlegroups.com On Behalf Of Vasanth Mohan Sent: Monday,

RE: CTRL-BREAK still make sense on Windows for `runserver`?

2021-06-21 Thread Matthew Pava
Ctrl + Break and Ctrl + C are treated slightly differently by Windows. Ctrl + Break is always a signal, but an application can override the functionality of Ctrl + C. Please see https://docs.microsoft.com/en-us/windows/console/ctrl-c-and-ctrl-break-signals I’ve dealt with this issue many

Re: Do people actually squash migrations?

2021-05-11 Thread Matthew Pava
I've had similar issues. I just avoid squashing anymore. It's just not with the pain, and having so many little files that get looked at a minimal amount of time isn't worth fretting over. Saying that, I'd love to get it fixed... Sent from my Verizon, Samsung Galaxy smartphone Get Outlook for

RE: Difference between AdminSite.admin_view and staff_member_required?

2021-03-09 Thread Matthew Pava
> Thoughts on deprecating it? It seems like a good idea. However, it leads us to another question. Do we really need the is_staff field on the User Model if it is deprecated? From: django-developers@googlegroups.com On Behalf Of Timothy McCurrach Sent: Tuesday, March 9, 2021 3:22 PM To:

RE: Incomplete documentation or bug? (linebreaksbr and stringfilter decorated filters)

2020-09-14 Thread Matthew Pava
The filter states that it expects plain text. In Python, str(None) = "None". To get the behavior you are seeking use the default_if_none filter, and chain your other filters. https://docs.djangoproject.com/en/dev/ref/templates/builtins/#default-if-none {{ text|default_if_none:""|linebreaksbr }}

RE: Django default input validation accepts special caracters

2020-08-18 Thread Matthew Pava
Thank you so much for sharing that, Adam. I’ve always wondered what the best way was to deal with names. The systems I work with should be able to handle names from all countries of the world. I find you kalzumeus link only slightly helpful, though. It explains what we shouldn’t do. I’d rather

RE: Subquery join support

2020-04-06 Thread Matthew Pava
It is my opinion that the Subquery object that already exists in Django should act as a CTE. There is a ticket for this feature already: https://code.djangoproject.com/ticket/28919 I have noticed that several developers have proposed several different patches for CTEs, but I do not know why

RE: Proposal: Multiple-Inheritance in Templates

2020-02-18 Thread Matthew Pava
I did read your post, and I did come to that conclusion. I may have ultimately misunderstood, and I’ll certainly take the blame for my own misunderstanding. The example you provided can be done without multiple template inheritance. So far, my thoughts on the design concept is that multiple

RE: Proposal: Multiple-Inheritance in Templates

2020-02-17 Thread Matthew Pava
In your example, you could just inherit from generic-list.html since it already extends base.html. You would be repeating yourself in your current example. orders/list.html {% extends 'generic-list.html' %} {% block list-item %} Order # {{ order.id }} (total: {{ order.total }}) {% endblock

RE: declarative settings

2019-12-30 Thread Matthew Pava
It's an interesting idea, and I'm not opposed to it myself; however, keeping the settings as Python code is not an abnormal practice compared to other software. I've been working with some Drupal stuff lately, and it is written in PHP. Drupal is a content management system that can be extended

RE: Deprecate HttpRequest.is_ajax

2019-11-18 Thread Matthew Pava
“In my opinion there are not many good reasons to have to change behaviour if a request is made via XHR. I think the most common usage is to have a single view that returns a JSON response or a HTML response depending on if XHR is used (https://github.com/search?l=Python=request.is_ajax=Code),

RE: Redis cache support in core

2019-09-05 Thread Matthew Pava
I’d just like to point out that Redis support on Windows is limited at best. All other technologies that Django uses, as far as I can recall, do support Windows. From: django-developers@googlegroups.com [mailto:django-developers@googlegroups.com] On Behalf Of Jacob Rief Sent: Thursday,

RE: Prefixing Q Objects

2019-07-10 Thread Matthew Pava
I had a use for such a feature, though I used an implementation more specific to my application. Basically, I have a model and then I have several other models that are directly related to that model. So in the base model I would have a field to determine if the instance was marked as deleted.

RE: Proposal to format Django using black

2019-05-02 Thread Matthew Pava
Just a thought: If Django were to adopt black (and I'm not saying it should), shouldn't it wait until it is out of the beta classification? -Original Message- From: django-developers@googlegroups.com [mailto:django-developers@googlegroups.com] On Behalf Of Markus Holtermann Sent:

RE: GSoC 2019 Update

2019-03-07 Thread Matthew Pava
This is more for the ORM side of things. Something I would like to see is the Subquery object morphed into the equivalent of common table expressions and the possibility of having recursive common table expressions. See https://code.djangoproject.com/ticket/28919. The patches that I’ve seen

RE: thoughts for Django fellowship applicants

2019-01-08 Thread Matthew Pava
that to this day. I would love to become a more consistent contributor, but my own lack of time prevents it. Thank you, Matthew Pava From: django-developers@googlegroups.com [mailto:django-developers@googlegroups.com] On Behalf Of Tim Graham Sent: Tuesday, January 8, 2019 10:45 AM To: Django

RE: Get decorator

2018-05-17 Thread Matthew Pava
I think the idea is that some developers may have fields on their models called “url” or “absolute_url” and having a property by that name would cause naming conflicts. (Actually, I think I ran into this issue once with my own projects.) Creating any property on a model in the Django core

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

2018-04-11 Thread Matthew Pava
Right. I just use python manage.py… I just checked python3 manage.py and it doesn’t work. From: collinmander...@gmail.com [mailto:collinmander...@gmail.com] On Behalf Of Collin Anderson Sent: Wednesday, April 11, 2018 7:46 AM To: django-developers@googlegroups.com Subject: Re: Shouldn't

RE: DEP Pre-posal: Re-Designing Django Forms

2018-02-05 Thread Matthew Pava
> It includes ajax file upload which every user expects in the modern web which > seems to be the feature which defines feature-completion of a UI framework, > compared to what HTML offers out of the box. Bandwagon logical fallacy (“every user expects”) In my project, I have no need for file

PR 9583 - Ticket 28643

2018-01-18 Thread Matthew Pava
Hi everyone, I've been working on ticket 28643 specifically adding Ord, Chr, Left, and Right to Django's built-in database functions. I've done the PR #9583. I am a new contributor, and I've never really contributed code to any project through pull requests ever before. I appreciate your

Re: PostgreSQL aggregation and views through unmanaged models

2017-12-11 Thread Matthew Pava
You asked me to join in on this conversation as I had an issue using Django 1.11. My third party apps do not yet all support Django 2.0. I have an unmanaged model that is connected to a view in PostgreSQL. I attempted to create an annotated version of the model manager using the .annotate()

RE: Additional PostgreSQL-specific functions

2017-11-17 Thread Matthew Pava
I wonder if we should put that in this ticket: https://code.djangoproject.com/ticket/28643 From: django-developers@googlegroups.com [mailto:django-developers@googlegroups.com] On Behalf Of Joey Wilhelm Sent: Friday, November 17, 2017 2:02 PM To: django-developers@googlegroups.com Subject:

RE: models.CalculatedField feature

2017-11-15 Thread Matthew Pava
I handle that situation quite differently. I have a model manager that annotates different fields to the queryset depending on when I need them. For your example, I would have something like this: class CustomerQuerySet(models.QuerySet): def with_allowed_to_drink(self): return

RE: #28788: Add support for Model.clean_

2017-11-09 Thread Matthew Pava
I don’t use Field.validators much myself, but it seems that the Form clean method also calls Field.validators, so the redundancy is already there in the Form class. For consistency’s sake, I suggest we either add Model.clean_fieldname(), or we remove Form.clean_fieldname(). Both suggestions

RE: How Django inlineformsets works internally

2017-10-13 Thread Matthew Pava
You might want to look at stuff that has already been developed. (No need to reinvent the wheel, right?) Check out this jQuery plugin for making a dynamic formset: https://github.com/elo80ka/django-dynamic-formset You might find some answers there. From: django-developers@googlegroups.com