Re: Django as Microservice

2019-08-07 Thread Adam Johnson
Hi Adan, Did you know startproject takes a URL for the template? See docs: https://docs.djangoproject.com/en/2.2/ref/django-admin/#startproject . You could use this to provide your microservice template in a separate location, for example a GitHub repo with a download URL. For more advanced proje

Re: Migrations: A bug or a feature needing documentation?

2019-08-07 Thread Adam Johnson
Hi Barry, I don't have a very strong opinion here, but replying with some questions, and to bump the thread. I think this smells more like a bug than a feature to me. I worry that if you depend on it, it could easily get refactored away in a future version of Django. If we were to document it as

Re: Expand the Scope of Pluggable Secret Keys Ticket

2019-08-08 Thread Adam Johnson
This should be a separate ticket. I'm not sure what you need for DB credential rotation - this can already be done by creating a second user in your database, then changing Django's config to use the new one, then deleting the old one. On Thu, 8 Aug 2019 at 02:43, John Gooding wrote: > Would it

Re: Ideas for a new DEP on long-term Django API compatibility

2019-08-08 Thread Adam Johnson
Pascal, I have had a short reply sitting in draft status for a while but not found the energy to read all of your posts. I'd just like to chime in and echo the sentiment from Aymeric, Florian, Luke, and Tim. I worked with Django for nearly 5 years before being accepted onto the core team. One of

Re: Django Models

2019-08-09 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: Django LTS support time

2019-08-09 Thread Adam Johnson
Hi Uri, For everyone's convenience here's the documentation on the release process: https://docs.djangoproject.com/en/dev/internals/release-process/ , and the grid of supported versions in time: https://www.djangoproject.com/download/ The current release cadence was decided 4 years ago in DEP 4 h

Re: Proposing development discussion forums

2019-08-10 Thread Adam Johnson
I'm up for a forum. I started replying on mailing lists because that's what there is, but it does get pretty messy and single thread driven. PHPBB anyone? Shame there isn't a mature Django based forum (that I know of). On Sat, 10 Aug 2019 at 11:30, Carlton Gibson wrote: > I've thought about thi

Re: I need help

2019-08-14 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: TemplateView and FormView inconsistency

2019-08-14 Thread Adam Johnson
Hi, After reading the ticket, I agree this could be deprecated as a backwards incompatibility. The deprecation plan suggested by loic84 looks like it could work but would be a bit unwieldy on large projects. Maybe there's another path? One thing that's not explicitly in the discussion: the view k

Re: TemplateView and FormView inconsistency

2019-08-14 Thread Adam Johnson
k > or another code search method, I do not think replacing them would take > long. > > Am 14.08.2019 um 09:45 schrieb Adam Johnson : > > Hi, > > After reading the ticket, I agree this could be deprecated as a backwards > incompatibility. The deprecation plan suggested by

Re: Django Chat Application using channels and SQS

2019-08-18 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: create microservice in django

2019-08-19 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: Creating a new "Triage & Review Team"

2019-08-19 Thread Adam Johnson
Sounds good to me too, looking forward to it! On Mon, 19 Aug 2019 at 16:30, Carlton Gibson wrote: > OK, thanks Josh, Aymeric. I shall roll it out (slowly as ever šŸ™‚) > > On 19 Aug 2019, at 17:10, Aymeric Augustin < > aymeric.augus...@polytechnique.org> wrote: > > Yes, I'm in favor of trying this.

Re: How to send emails using django rest framework from front end angular 7

2019-08-29 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: Displaying model in a template.

2019-08-31 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: Add support for multiple path converters on urls.path()

2019-08-31 Thread Adam Johnson
Hi Marco, Thanks for writing a clear, short proposal. This could be neat, but I'm against it for these reasons: - It's extra syntax - the advantage of the new URL syntax is that it's very simple and easy to pick up. It's copied from Flask, which also doesn't support a "multiple converte

Re: Feature request: get user by session key

2019-08-31 Thread Adam Johnson
be an idiot", but I think > this small refactoring will be good anyway, even for Channels. I don't > quite understand what you mean by saying "isn't the only thing that would > need changing"; as of today, I have not noticed any problems when worki

Re: calculating two integers fields in django..

2019-09-02 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: Clean Architecture in Django

2019-09-02 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: Django-filter customization for rest api

2019-09-06 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: A post database write signal

2019-09-06 Thread Adam Johnson
Hi Anthony, The idea of some form-related signals has previously been suggested, and there's an open ticket: https://code.djangoproject.com/ticket/27923 and the mailing list thread: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/django-developers/SviNiWy3Bjc/fqFL8rZvBAAJ

Re: Project to receive the first 500 bytes of a file coming from client-side before it gets completely downloaded onto the server.

2019-09-06 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: Create a shortcut for raising ValidationError from within the Form.clean() method

2019-09-06 Thread Adam Johnson
Hi Lucas, Thank you for writing to the list with your proposal. At first glance, I'm not sure of the value. Shortcuts are nice but they come at the expense of there being two ways to do things. Your example might not best express your idea, but if I were to refactor it to what Django currently s

Re: Create a shortcut for raising ValidationError from within the Form.clean() method

2019-09-09 Thread Adam Johnson
Hi Lucas, In the case that you want to apply an error to a specific field, there's the add_error method (docs: https://docs.djangoproject.com/en/2.2/ref/forms/api/#django.forms.Form.add_error ). For your example (untested): def clean(self): cleaned_data = super().clean() password = clea

Re: The floatformat filter sometimes returns "-0" rather than "0"

2019-09-12 Thread Adam Johnson
+1 to swapping -0 for 0 On Thu, 12 Sep 2019 at 12:44, Kye Russell wrote: > Sounds reasonable. As you said, the template tags (well, this one) seem to > be to prepare things for human consumption, not to expose computer science > intricacies. > > If I saw this presented on a website, as a ā€˜develo

Re: Migrations in Django 1.7 make unit testing models harder

2019-09-14 Thread Adam Johnson
Hi Dylan, In my experience, high availability deployments often need to commit model changes without migration changes. For example, when removing a (nulable) field, the best approach is to: 1. Remove the field from Django 2. Test 3. Deploy 4. Run makemigrations to generate the migrat

Re: Migrations in Django 1.7 make unit testing models harder

2019-09-14 Thread Adam Johnson
o I > may take a look at spinning up an external package for this. > > Le sam. 14 sept. 2019 5:36 a.m., Adam Johnson a Ʃcrit : > >> Hi Dylan, >> >> In my experience, high availability deployments often need to commit >> model changes without migration changes. For

Re: Migrations in Django 1.7 make unit testing models harder

2019-09-14 Thread Adam Johnson
(Fixed Ryan's link: https://github.com/aspiredu/django-safemigrate ) On Sat, 14 Sep 2019 at 17:12, Adam Johnson wrote: > I'm interested in your use case: why do you need the model changes without >> the migrations? I.e. why would you want to be in a state that's >>

Re: distinct on fields is not supported by this database backend sqlite3

2019-09-16 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: docs request: signals documentation warning

2019-09-21 Thread Adam Johnson
Hi Cesar, I think the community consensus is exactly where you're at: signals are only useful in limited cases. We've even resisted adding more signals to Django core in recent years. Although the Django documentation tends to be quite neutral I think a single paragraph listing the pros and cons

Re: docs request: signals documentation warning

2019-09-24 Thread Adam Johnson
Made a PR with a small paragraph: https://github.com/django/django/pull/11814 I tried to be as succinct as possible but perhaps more words would be better. On Sun, 22 Sep 2019 at 20:44, Christian GonzƔlez < christian.gonza...@nerdocs.at> wrote: > Am 22.09.19 um 20:53 schrieb Cesar Canassa: > > >

Re: feature request: add iso_week_day to querysets, analogous to iso_year

2019-09-25 Thread Adam Johnson
I found the ticket for iso_year, it also mentioned weeks but didn't end up implementing it: https://code.djangoproject.com/ticket/28649 I'm not quite sure why. You probably know more than me. Please open a nwe ticket and create a PR ("patch") for it with your code - instructions for all those on h

Re: feature request: add iso_week_day to querysets, analogous to iso_year

2019-09-26 Thread Adam Johnson
Right, my bad. So itt looks like we h ave week_day which has sunday = 1, while ISO week days have monday = 1. What other "peculiar and unintuitive" behaviour is there Anatol? On Wed, 25 Sep 2019 at 15:39, Mariusz Felisiak wrote: > In this ticket we mentioned *iso_week* not *iso_week_day*. *wee

Re: The floatformat filter sometimes returns "-0" rather than "0"

2019-09-26 Thread Adam Johnson
pening it. > > It's been two weeks since the last reply. > > What's the next step now? > > > On 2019-09-12 21:52, Adam Johnson wrote: > > +1 to swapping -0 for 0 > > > > On Thu, 12 Sep 2019 at 12:44, Kye Russell wrote: > > > >> Sounds re

Re: Stalled tickets

2019-09-27 Thread Adam Johnson
I'm also not sure of the value of closing stalled tickets. Closing them makes them less visible, and as Claude says, they're still valid. Often I find one that's been open years has "come up again" on the mailing list or client work. The fellows are the ones who work the most with ticketing system

Re: Question about ticket #15610: Generic Foreign Keys break when used with multi-db

2019-09-27 Thread Adam Johnson
> > However, when generic foreign relations are created in a multi-db system > using Django migrations, separate content-type tables are created for each > db. Does this not depend on the db_for_migrate and db_for_write methods of any relevant database router? I think only one database could hav

Re: Stalled tickets

2019-09-27 Thread Adam Johnson
Hi Peter, I do recommend that tickets need to be checked upon and acted on when: > A new minor/major version is released. If the ticket is also related to > the newer version include this version into the ticket so people know it's > still an issue for that version as well. > The version related

Re: About users

2019-09-30 Thread Adam Johnson
Hi Burak The reason the custom user model feature exists is because there are so many "really simple" changes possible. Adding them all as options to Django itself would add many such switches and a large maintenance burden. For the exact change you're suggesting, there's a third party package ou

Re: Desired behaviour when passing a non boolean to filter(*__isnull)

2019-09-30 Thread Adam Johnson
Hi AndrƩ I think Django should use the truthy value. Please open a ticket with your bug report and then a PR. Thanks, Adam On Mon, 30 Sep 2019 at 15:37, AndrƩ Ericson wrote: > Hello, > > I came across the discovery (due to a bug on our code) that it's possible > to pass a non-boolean to the _

Re: id the field is required - error in Django formset

2019-10-03 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: Question about ticket #20456: Easier unit testing for class-based views

2019-10-07 Thread Adam Johnson
Moving the head=get line sounds sensible to me! On Sun, 6 Oct 2019 at 17:31, Felipe Lee wrote: > Hi everyone, > > I was looking into ticket #20456 ( > https://code.djangoproject.com/ticket/20456), which is to improve the > ease of testing class-based views (cbvs). It's been a while since anyone

Re: Explore integrating django-docker-box in some way?

2019-10-08 Thread Adam Johnson
+1 to archiving django-box On Tue, 8 Oct 2019 at 11:01, Tom Forbes wrote: > Thank you for the kind words Bruno! I'm glad it's helped you, if you have > any suggestions for improvements then please open an issue on the repo or > post a message here, I know it's not perfect. I would have replied e

Re: Removing old branches from the Django Git repository.

2019-10-10 Thread Adam Johnson
Can we leave magic-removal as a tag since it’s such a pivotal point in djangos history? xD On Thu, 10 Oct 2019 at 19:09, Mariusz Felisiak wrote: > Hi y'all, > > We're going to remove some old branches from the Django Git repository > on 1st November 2019: > >- *9* old branches related wi

Re: Stop QuerySet repr from executing queries

2019-10-10 Thread Adam Johnson
I’m in favour of changing repr to not execute. Luke’s reasoning seems reasonable. On Thu, 10 Oct 2019 at 17:15, Ryan Hiebert wrote: > > > On Thu, Oct 10, 2019 at 10:50 AM Matt wrote: > >> >> I think we ought to reconsider the behavior of repr on QuerySets. I'm of >> the opinion that we should s

Re: CSV row delete problem(using pandas)

2019-10-11 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: #30864 Document and endorse django.utils.decorators.classproperty

2019-10-17 Thread Adam Johnson
Hi Keshav, Thanks for volunteering. The most recent comment says #30876 should be done first - maybe try do that? This guide shows you how to get started editing the documentation: https://docs.djangoproject.com/en/dev/internals/contributing/writing-documentation/ This guide, and some linked gui

Re: #30864 Document and endorse django.utils.decorators.classproperty

2019-10-18 Thread Adam Johnson
Carlton wrote a message recently about the best places to get started, maybe this is of help: https://groups.google.com/d/msgid/django-developers/362f9b32-4af3-4913-877d-f2507e843546%40googlegroups.com?utm_medium=email&utm_source=footer He also gave a great talk: https://www.youtube.com/watch?v=F4

Re: Adding Occitan language code 'oc' in LANG_INFO

2019-10-25 Thread Adam Johnson
Hi Yann, I'm no translation expert, but I believe you can add your own language codes in your project and translate your project's strings. To be added to core django I think we need (at least some) translation coverage. The last language added was Armenian, in this PR: https://github.com/django/d

Re: Adding Occitan language code 'oc' in LANG_INFO

2019-10-29 Thread Adam Johnson
t > expanding it. > > Anyway, I tried to expand it, it seemed to work. > > I did this in my settings file: > > LANGUAGES.append( > ('oc', gettext_lazy('Occitan')), > ) > > Would you say that my understanding is correct? Is my solution correct? > The best

Re: Python version support for LTS Django (in particular v2.2)

2019-10-30 Thread Adam Johnson
I'm also in favour of adding 3.8 support and backporting 3.9 support assuming it's not a huge change! On Wed, 30 Oct 2019 at 16:39, Tobias McNulty wrote: > On Wed, Oct 30, 2019 at 12:29 PM Carlton Gibson > wrote: > >> That _highly recommend_ sentence could go: >> >> > We highly recommend and on

Re: GitHub Actions

2019-10-31 Thread Adam Johnson
Nice, I've been playing with GitHub actions and I'm impressed. Will move my projects over from Travis at some point. Thanks for your work Tom (Likewise on side note - I did not see Johannes' first message) On Thu, 31 Oct 2019 at 10:08, Tom Forbes wrote: >  >  > Yep! My life has been unexpecte

Re: pass list parameter from one class view to another

2019-11-05 Thread Adam Johnson
Hi! I think you've found the wrong mailing list for this post. This mailing list is for the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer yo

Re: Help needed with the MySQL max index length problem for Django 1.10

2016-01-04 Thread Adam Johnson
This has always been an error on MySQL afaik, it would allow broken data integrity if it were just a warning. Moving the length below 191 does seem to be the safest fix. On Wednesday, December 30, 2015 at 1:52:27 PM UTC, Collin Anderson wrote: > > I think mysql used to just give a warning and ma

Re: should manage.py test run system checks?

2016-01-31 Thread Adam Johnson
Y'all know my position (original author). How long are the checks taking for people? We have a very large project with >100 models, ~30 apps, and it still takes less than a second. On Thursday, October 22, 2015 at 12:15:59 PM UTC+1, Žan Anderle wrote: > > Adam: I don't think they should be optio

Re: Deprecate Cache.has_key()?

2016-01-31 Thread Adam Johnson
Might be problematic for third-party cache backends which implement *has_key* and rely on *__contains__* calling it - don't see how you can show the warning in that case. On Saturday, January 30, 2016 at 12:34:14 PM UTC, Tim Graham wrote: > > Yes, but dict.has_key() is removed in Python 3. If we

Re: Query on BooleanField with values other than True and False, bug or intentional?

2016-01-31 Thread Adam Johnson
Just to play devil's advocate... you're all worrying about one simple case; there are infinite variants of it with subtle bugs, for example imagine the same situation but with *Value*: Whatever.object.filter(is_active=Value('false')) The ORM can't predict the type of a *Value* call - pretty muc

Re: View permissions to admin

2016-01-31 Thread Adam Johnson
Hi, At YPlan we've hacked in view permissions to the admin, exactly because of the reasons Markus talked about - it's the front end we've built for employees, done rather than building a proper process-based interface. I think it could just about be done in a third-party package (It might rely

Re: [Question] MySQL Microseconds stripping

2016-02-05 Thread Adam Johnson
Hi, I've just finished converting all the datetime columns to datetime(6) in our database after an upgrade to MySQL 5.6. We don't use Django migrations, many of these were done manually with *pt-online-schema-change*. Just catching up on this thread, throwing some ideas in. Why not strip the m

Re: django template modules compiled with cython

2016-02-05 Thread Adam Johnson
Hi guys, I work with Alex here at YPlan. We deployed a tidied updated version of Alex's code as django-speedboost, since it looked promising in local profiling. You can see the code here: https://github.com/YPlan/django-speedboost . It uses a Cythonized version of Django 1.8.8's template engin

Re: django template modules compiled with cython

2016-02-08 Thread Adam Johnson
oach. > I believe this is quite alpha yet but looks promising: > https://github.com/Microsoft/Pyjion > > El viernes, 5 de febrero de 2016, 13:23:59 (UTC-3), Adam Johnson escribió: >> >> Hi guys, >> >> I work with Alex here at YPlan. We deployed a tidie

Re: [Question] MySQL Microseconds stripping

2016-02-11 Thread Adam Johnson
I've released the forementioned command as part of Django-MySQL, see here: https://django-mysql.readthedocs.org/en/latest/management_commands/fix_datetime_columns.html On Friday, February 5, 2016 at 1:03:42 PM UTC, Adam Johnson wrote: > > Hi, > > I've just finished conve

Proposal: django.contrib.mysql

2016-03-03 Thread Adam Johnson
The *django.contrib.postgres* docs state: There is no fundamental reason why (for example) a contrib.mysql module > does not exist *Well...* over the past year and a bit I've been developing Django-MySQL. It has a ton of features specific to MySQL and/or MariaDB. For a quick tour of the featu

Re: Proposal: django.contrib.mysql

2016-03-15 Thread Adam Johnson
n’s ā€œstandard >>> library is where modules go to dieā€ problem. >>> >>> It would obviously help if other community members expressed interest in >>> django.contrib.mysql or, even better, intent to help maintain it in the >>> future. >>> &

Re: Test projects needed for removal of Field.get_db_prep_lookup()/get_prep_lookup()

2016-05-23 Thread Adam Johnson
Just bumped up against this in Django-MySQL, fixing in django-mysql/pull/292 . In most cases it's easy to work around, but this usecase is not the most fun - wrapping values for the default lookups on the JSONField: https://github.com/adamch

Re: Window expressions, #26608

2016-11-29 Thread Adam Johnson
As to your point 1: > Since this is specific to postgres Well, Window expressions aren't specific to Postgres: - They exist in Oracle - They exist in MariaDB 10.2 which is in beta and will be GA at around the same time this patch is out: https://mariadb.com/kb/en/mariadb/window-

Re: Window expressions, #26608

2016-11-29 Thread Adam Johnson
I'm not sure about that detail atm, I need to review the patch. I just think we shouldn't be putting anything in postgres-only land. On 29 November 2016 at 22:04, Josh Smeaton wrote: > Adam, are you thinking we should be adding something like > Model.objects.window(), or just allowing Window-typ

Re: Admin changelist turns QueryDict into dict

2016-11-30 Thread Adam Johnson
I suspect it was simply to make it easier to work with. I'd suggest you create a ticket at https://code.djangoproject.com/newticket and then try making the change and seeing if Django's test suite still passes. All the information you should need is at https://docs.djangoproject.com/en/dev/inte

Re: Guidelines to name python modules of Django applications?

2016-12-08 Thread Adam Johnson
+1 (to what Aymeric and Florian said) On 7 December 2016 at 19:54, Robert Roskam wrote: > +1 > > On Wednesday, December 7, 2016 at 11:25:05 AM UTC-5, Marc Tamlyn wrote: >> >> What Aymeric and Florian sayid. >> >> On 7 December 2016 at 15:58, Florian Apolloner >> wrote: >> >>> On Wednesday, Dece

Re: GeoDjango OffdbRasterField

2016-12-15 Thread Adam Johnson
I can't say I'm that familiar with GeoDjango, but that does sound like a useful feature. Where does the data get stored if not in the DB? And does this feature exist on any of the other database backends that GeoDjango supports? On 14 December 2016 at 18:40, Piero Toffanin wrote: > Hello, > > No

Re: Please help me with "Writing your first patch for Django"

2016-12-17 Thread Adam Johnson
Also you might be experiencing failures specific to your operating system and database setup - if you'd paste the stack traces we might be able to figure more out. On Sat, 17 Dec 2016 at 16:27, Tim Graham wrote: > 1. As the tutorial says, "Some tests are specific to a particular > > database back

Re: Please help me with "Writing your first patch for Django"

2016-12-18 Thread Adam Johnson
> > That appears to be the full stack trace since it errors out in the assert >> :D > > Oh yes, my bad, I'm used to pytest ;) > On Sunday, December 18, 2016 at 2:15:54 PM UTC, Florian Apolloner wrote: > > > > On Saturday, December 17, 2016 at 7:08:23 PM UTC

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-18 Thread Adam Johnson
Since they were used in several places in Django's test suite I feel like it's highly likely they're out there in use in the wild. Also if Django were to remove it, it would both 1) be a bit surprising compared to the re module, as it's an implementation detail that the urlparser prefixes '^/' an

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-19 Thread Adam Johnson
ter match any character at > all, including a newline; without this flag, '.' will match anything except > a newline. > > re.U -- Unicode -- these are redundant in Python 3 since matches are > Unicode by default for strings > > On Sunday, December 18, 2016 at

Re: Considering removing support for ("iLmsu") regex groups in URLpatterns. Do you use them?

2016-12-20 Thread Adam Johnson
I think the current implementation means they affect all included children. On 20 December 2016 at 07:15, Sjoerd Job Postmus wrote: > On Mon, Dec 19, 2016 at 08:23:09AM +0000, Adam Johnson wrote: > > > > > > I guess the "safest" option is to keep the code around

Re: #26369: default formfield callback override

2016-12-22 Thread Adam Johnson
I've only skimmed the original thread so idk if the following was suggested there. What I'd suggest for your project for the first condition is: 1. Subclass the model field you want to change and make it default to having widget=RadioSelect: class RadioSelectForeignKey(ForeignKey): def formfi

Re: #26369: default formfield callback override

2016-12-22 Thread Adam Johnson
Oh, I misunderstood, I thought you controlled both the models and forms but wanted to enforce consistency. If you don't control the models (like FlatPage), I presume you control the forms then?You can do it then with a custom ModelForm subclass that overrides some of the building behaviour. You

Re: #26369: default formfield callback override

2016-12-22 Thread Adam Johnson
I was suggesting in your project you subclass the ModelFormMetaclass, use it in your own subclass of ModelForm, and use that everywhere in your project. Fatpage is an imaginary fork of flatpages that adds create and edit views > There are a lot of problems out there with imaginary third party a

Re: Should SECRET_KEY be allowed to be bytes?

2016-12-22 Thread Adam Johnson
+1 to what Aymeric wrote. I was just drafting an email with a similar argument about how it's hard to manage pure bytes in config management systems that write to env vars, that's why ascii strings are so useful. They're also easy to copy/paste and verify when adding them to your config management.

Re: #26369: default formfield callback override

2016-12-23 Thread Adam Johnson
> > The ModelFormMetaclass usage you suggest is not supported by Django at > this point Sorry if I was unclear, I meant something like this (untested): class MyModelFormMetaclass(ModelFormMetaclass): """ Customize the way our forms get built """ def __new__(*args, **kwargs):

Re: No 'Content-Type' header in response

2016-12-26 Thread Adam Johnson
Hi GMail! (you might want to fix your name used on google groups, I had the same problem ;) ) This seems to be a legitimate bug in the __repr__ to me - SO informs me that DRF is correct in not defining a Content-Type for a 204 as it has no body: https://stackoverflow.com/questions/21029351/what-co

Re: What is the contract of a cache backend regarding errors?

2016-12-26 Thread Adam Johnson
Hi Jean, I wrote a cache backend for MySQL in Django-MySQL and didn't add any special error handling. Like the builtin database cache backend, it uses the same connection as the ORM, so if an error does occur it's pretty likely the whole request is broken anyway. If you look at the code, Django's

Re: #26369: default formfield callback override

2016-12-26 Thread Adam Johnson
I've thought a bit more about this, and have had three ideas: 1. The signal idea doesn't seem likely to work in all cases due to import order considerations. Forms can easily be imported during Django startup whilst models, views, or urls, are imported, before AppConfig.ready() is fired, which is

Re: Adding UNION/INTERSECT/EXCEPT to the ORM

2016-12-26 Thread Adam Johnson
Yes it's different, they cannot be changed due to backwards compatibility issues. They don't result in UNION in SQL, they union the filters on two querysets that are on the same exact model. On 26 December 2016 at 21:00, Cristiano Coelho wrote: > Is this going to be different from the pipe ( | )

Re: Should we add a dependency on the multipledispatch library, or vendor it?

2017-01-02 Thread Adam Johnson
I agree, it doesn't seem likely there will be breaking changes in it either. According to DEP007 ( https://github.com/django/deps/blob/master/draft/0007-dependency-policy.rst ), dependencies should go through on the feature DEP rather than just via the mailing list. And btw was https://pypi.pytho

Re: MariaDB, official support

2017-01-02 Thread Adam Johnson
Hi, Sorry I missed this thread! Adam is (or is planning..) writing a DB backend that includes MySQL and > MariaDB > Not technically, I'm actually writing a backend to use the newer MySQL DBAPI library pymysql at https://github.com/adamchainz/django-pymysql-backend . For the first pass at lea

Re: Working towards a simpler GCBV implementation?

2017-01-03 Thread Adam Johnson
I think this is probably too disruptive a change for Django core, especially after so long with the current GCBV implementations - it would require all users to rewrite their CBV's. Possibly the documentation could recommend django-vanilla-views? On 3 January 2017 at 13:02, Asif Saifuddin wrote:

Re: Methodology for increasing the number of PBKDF2 iterations

2017-01-03 Thread Adam Johnson
> > But, to be consistent with Django 1.x going forward, let's define 36,000 > iterations as "acceptable performance" for a Python2 with Django 1.11 > install on a typical piece of server hardware today (beginning of 2017). A > useful benchmark would be to determine how many iterations would yield

Re: Methodology for increasing the number of PBKDF2 iterations

2017-01-04 Thread Adam Johnson
Thanks Alex, TIL https://mail.python.org/pipermail/distutils-sig/2016-May/028986.html On 4 January 2017 at 17:42, Alex Gaynor wrote: > Python 2.7.12 will look the same as 3.5.x, they both have the optimized > implementation. Only 2.7.X where X<8 will have the slow implementation. > > If someone

Re: Working towards a simpler GCBV implementation?

2017-01-04 Thread Adam Johnson
fuddin wrote: >> >> Hi, >> >> I will update the doc pointing vanilla views as simpler alternative >> implementation. >> >> Thanks >> >> On Tuesday, January 3, 2017 at 7:20:24 PM UTC+6, Adam Johnson wrote: >>> >>> I think

Re: Add custom autoreload file tracking options setting

2017-01-04 Thread Adam Johnson
For that use case I'd suggest just re-executing prepare_db_queries on every page view when DEBUG=True. This is similar to how Django's template loaders work without the cached loader wrapping them. On 4 January 2017 at 21:12, Bobby Mozumder wrote: > OK here is some example code snippet where I l

Re: Add custom autoreload file tracking options setting

2017-01-04 Thread Adam Johnson
> > How do people serve development Javascript & CSS files? These days > Javascript & CSS involves a large build process. Are we forced to manually > restart the development server every time Javascript changes? Django just serves them from the filesystem, and doesn't cache them itself. You rel

Re: django-formtools is neglected/unmaintained

2017-01-04 Thread Adam Johnson
1) Tim added testing on Django 1.10 in July 2016, it seems to work? https://github.com/django/django-formtools/commits/master 2) New contributors are always welcome 3) I don't know of other packages, you can check https://djangopackages.org/ 4) It's true that many websites are built with pure JS fr

Re: Changing {% include %} to strip a trailing newline

2017-01-04 Thread Adam Johnson
2 or 3, however, I have a strong >> distaste for anything more complicated. >> >> Best regards, >> >> -- >> Aymeric. >> >> On 4 Jan 2017, at 20:58, Tim Graham wrote: >> >> Shortly after template widget rendering was merged, an issue

Re: Changing {% include %} to strip a trailing newline

2017-01-04 Thread Adam Johnson
cessary for some more > > advanced uses of templates out there, e.g. templating whitespace > > sensitive file formats." -- I'm not following why a similar find/replace > approach wouldn't be sufficient to adapt those templates? > > > On Wednesday, January 4,

Re: Template handling of undefined variables

2017-01-06 Thread Adam Johnson
> > I apologise if adding the tests has made it harder to improve the > behaviour of the tag. I don't think you have anything to apologise for! More tests is always better. This has clarified the current behaviour šŸ‘Œ On 6 January 2017 at 10:15, Alasdair Nicol wrote: > Hi, > > On Thursday, 5 Jan

Re: Use of HTML autofocus attribute in admin (#27692)

2017-01-06 Thread Adam Johnson
I think we should remove it and maybe add the Javascript back, this is going to affect many peoples' workflows, some of whom are in my organization. On Friday, January 6, 2017 at 5:48:12 PM UTC, Tim Graham wrote: > > As part of removing inline JavaScript in the admin [0], snippets such as > doc

Re: Use of HTML autofocus attribute in admin (#27692)

2017-01-09 Thread Adam Johnson
t though, I'd still like the autofocus to be either removed or > optional. > > Op vrijdag 6 januari 2017 18:54:54 UTC+1 schreef Adam Johnson: >> >> I think we should remove it and maybe add the Javascript back, this is >> going to affect many peoples' workflows,

Re: Responsive admin

2017-01-09 Thread Adam Johnson
> > - perhaps supplying an empty CSS file with the same name overrides the > file provided by the admin? (I’m not sure) It does, as long as the app it's in is before django.contrib.admin in INSTALLED_APPS, django-grappelli uses this mechanism t

Re: [Feature request] Template language type annotations (#27703)

2017-01-09 Thread Adam Johnson
I think a third party implementation could be done first for the separate tag. I also think you'd learn more and iterate faster by building some tooling on top of the tags whilst a third party app before merging with core was considered. One idea that springs to mind is allowing multiple type decla

Re: Removing aliased imports ("from") in generated migration files to prevent conflicts

2017-01-09 Thread Adam Johnson
There's a 6th way, which is to alias the probematic modules rather than django's modules, e.g. from django.db import models import models as models_ ... Field( default=models_.my_default ) ... There's also a 7th way, which is to use flake8 which will, with its default config, complain about

<    2   3   4   5   6   7   8   9   10   11   >