Re: Proposal for a transaction.on_before_commit

2021-10-12 Thread Raphael Michel
Hi, Am Sun, 10 Oct 2021 18:38:55 +0300 schrieb Shai Berger : > Why is a before-commit signal preferable to a vanilla Python > context-manager around the code? Or, if it is in the context of > requests, a middleware? basically mostly because you can forget to put the context manager around it and

Re: Proposal for a transaction.on_before_commit

2021-10-12 Thread Raphael Michel
Hi Aymeric, thank you for the insightful reply. Indeed I have overlooked the issue with savepoints which makes it much more fragile. In our case, "not using savepoint rollbacks any more" would be a trade-off that we'd happily make (there are enough other problems with savepoints to begin with),

Proposal for a transaction.on_before_commit

2021-10-10 Thread Raphael Michel
Hi everyone, I've spent some days thinking about a use case we have internally where we want to create some database records automatically based on some other records, think e.g. of an audit log where whenever an instance of model X is changed, we want to create an instance of model Y as a log

Re: GSoC Proposal: Add Cross-DB JSONField, ArrayField, and HStoreField

2019-04-16 Thread Raphael Michel
Hi Sage, Hi everyone, I lacked the time to read this mailing list in the past months, and someone at DjangoCon Europe just pointed me to this thread, so just for reference, I want to add some prior work that I did to the list: At DjangoCon US and thereafter, I developed a third-party

Re: Adding a database-agnostic JSONField into Django

2018-10-21 Thread Raphael Michel
Hi, On Saturday, October 20, 2018 at 10:48:04 PM UTC+2, Adam Johnson wrote: > > The main thing is that MySQL added a binary JSON type, whilst MariaDB just > made the JSON type an alias for TEXT (plus the corollaries that implies): > https://mariadb.com/kb/en/library/json-data-type/ > Yes, this

Re: Adding a database-agnostic JSONField into Django

2018-10-19 Thread Raphael Michel
Hi everyone, I used the sprints at DjangoCon US to work on this issue in form of a third-party package. Mainly, I created a subclass of django.contrib.postgres.fields.JSONField that - includes code from django-mysql to work on MySQL 5.7+ as well - does some nasty hacks to even work on

Re: Adding a bulk_save method to models

2018-09-14 Thread Raphael Michel
Hi, I'd be very careful about calling it bulk_save(), since calling it something with save() very strongly suggests that it calls pre_save or post_save signals. Best Raphael Am Fri, 14 Sep 2018 07:56:38 -0700 (PDT) schrieb Tim Graham : > > > I wanted to ask about naming of the new method.

Re: Dynamic app loading

2018-08-01 Thread Raphael Michel
Hi, Am Tue, 31 Jul 2018 23:18:32 +0200 schrieb Christian González : > Whow, I'm quite impressed. Never stumbled upon that. I'll recommend > that for some collegues (to use it...) Thanks =) > But about the internals: Nice, this was the first way I implemented > that as well, and maybe I will

Re: Dynamic app loading

2018-07-30 Thread Raphael Michel
Hi Christian, we are doing such a thing for quite a while in our open source project pretix[1]. I'm not sure if its something that Django needs to do better, since requirements for this tend to deviate a lot and there's already a solid basis in the Python packaging toolchain to start from: To

Re: Why doesn't the framework provide support for translated database content?

2017-06-13 Thread Raphael Michel
Hi Bernhard, fyi: a similar topic was recently discussed here[0]. My point of view: I recently counted 19 packages for this purpose, six of them being actively maintained. You already mentioned that there are two ways that you can design the database layout (I argue there are three, but thats

Re: Model translation and meta options

2017-02-14 Thread Raphael Michel
Hi Claude, I spent some time looking at the implementations out there and in one of my projects I'm running a custom one, that uses yet another approach (that I plan to release as a library some day). It is not only that we are not yet ready to bless one of them, I have a feeling that we never

Re: Should ugettext_lazy return instanceof unicode? Or are reusable apps responsible for calling force_text a lot?

2016-10-23 Thread Raphael Michel
Hello, Am Fri, 21 Oct 2016 13:49:16 -0700 (PDT) schrieb Mike Edmunds : >1. Should the result of ugettext_lazy somehow inherit from > unicode? I believe this would break giant measures of code out there that use "not isinstace(lazystr, unicode)" exectly to detect that it

Re: DEP pre-proposal for a simpler URLs syntax.

2016-10-04 Thread Raphael Michel
Hi, Am Tue, 4 Oct 2016 00:11:28 +0200 schrieb Markus Holtermann : > Thanks for the draft, Tom. I'm a bit concerned that the different > `url*()` functions you can import will become confusing. Can we have > `regex_url()` (with chim for `url()`) -- as proposed -- and >

Re: Suggestion: Context manager for translation.activate

2016-09-20 Thread Raphael Michel
Could you just ignore that I've ever sent this mail? Apparently, I wasn't able to finde translation.override in the docs. Sorry for the noise. Raphael Am Tue, 20 Sep 2016 14:11:11 +0200 schrieb Raphael Michel <m...@raphaelmichel.de>: > Hi, > > in my application, I regularly

Suggestion: Context manager for translation.activate

2016-09-20 Thread Raphael Michel
Hi, in my application, I regularly need to switch the active language for a short period of time. A popular example would be that a German-speaking user does something and I need to send out a notification to an English-speaking user. Cluttering the code with translation.activate() statements is

Problems with cache.get_or_set behaviour

2016-02-28 Thread Raphael Michel
Hi, I just experienced the following behaviour and would like to ask for your opinion whether I should file this as a bug or whether this is intended behaviour. I today had the pleasure to work with a crashed memcached deaemon that could not restart because of a permission problem. In this case,

Re: Channels integration plan, first draft

2015-12-17 Thread Raphael Michel
Hi, Am Thu, 17 Dec 2015 12:27:07 -0700 > I'll admit to not being an expert on this use case at all, since I > don't generally do it, but AFAIK SCRIPT_NAME remains pretty key for > transparently deploying a Django site at non-root URL paths. I used this before and can confirm that it is

Re: annoyance with Python 3.2 support in Django 1.8

2015-11-26 Thread Raphael Michel
Hi, Am Wed, 25 Nov 2015 16:36:52 -0800 (PST) schrieb Tim Graham : > b. Install the latest non-broken Python 3.2 release (3.2.5) > "manually" (without using deadsnakes) on the newer CI servers While it would only really hurt the people in charge with the bugfix releases, as

Re: Validate domains against IDNA2008 instead of IDNA2003?

2015-09-02 Thread Raphael Michel
Hi, Am Wed, 2 Sep 2015 14:35:22 -0700 (PDT) schrieb Tim Graham : > However, python standard lib [ > https://docs.python.org/3/library/codecs.html?highlight=idna#module-encodings.idna > > only offers IDNA2003] validation in , and one have to use [ >

Re: A new setting for custom gettext domains?

2015-08-20 Thread Raphael Michel
Hi, I think the setting is worth it, it can be really useful when working with complex translation setups. However, I feel that LOCALE_FILENAMES is a poor choice for the setting name, as it differs from standard gettext terminology in a very unclear way. Why not name it LOCALE_DOMAINS? (To me,

Re: Should migrations have their imports sorted?

2015-07-26 Thread Raphael Michel
Am Sat, 25 Jul 2015 16:32:21 -0700 (PDT) schrieb Tim Graham : > I think it's been addressed in 1.9 to at least some extent. See > https://github.com/django/django/commit/7f20041bca43ca33f0a9617793f2af7ab07c3fab Oh, I didn't find that. Wonderful, sorry for the noise :)

Should migrations have their imports sorted?

2015-07-25 Thread Raphael Michel
Hello, some time ago, Django started to use isort to make sure imports are formatted and sorted consistently throughout the codebase. I like this very much, so I started adopting this practice for my own codebases. However, today I noticed that when Django generates a migration, the imports in

Re: Why deprecate the ability to reverse using the Python path?

2015-04-16 Thread Raphael Michel
Am Thu, 16 Apr 2015 01:21:04 -0700 (PDT) schrieb guettli : > We never jumped on the "give the URLs a name" wagon. Why don't you go with Tim's idea to implement a custom url() method to automatically give the views their path as URL names? This should be rather easy and you

Re: Two phase cleaning of models/forms

2015-04-08 Thread Raphael Michel
Hi, Am Thu, 2 Apr 2015 09:15:42 -0700 (PDT) schrieb Preston Timmons : > One use case is for validating address forms. We deal with a lot of > them with varying levels of validation based on country, state, zip > code, etc. Sometimes, multiple sets of address fields

Re: Password validation in Django revisited

2015-03-08 Thread Raphael Michel
Hi Erik, Am Sun, 8 Mar 2015 15:47:27 +0100 schrieb Erik Romijn : > I've taken another stab at 16860[1]: having a password > validation/policy in Django. I've made an initial simple PR[2] to > show the approach I'd like to use - no tests or documentation yet, > the example

Re: Psycopg2 version support

2015-02-16 Thread Raphael Michel
Am Mon, 16 Feb 2015 01:15:53 -0800 (PST) schrieb Thomas Stephenson : > The postgres-*.*-dev libraries are a requirement for both 2.0.14 and > 2.5, so if it's possible to install 2.0.14 via the package manager > then it's possible to pip install 2.5. No, I believe this is not

Re: Feature proposal: Conditional block tags

2015-02-01 Thread Raphael Michel
Hi, Am Sat, 31 Jan 2015 22:36:05 +0100 schrieb Aymeric Augustin : > I suspect it has to do with {% if %} being interpreted at runtime > while {% block %} is interpreted at compile time. > > I never investigated this fully. If someone does, I’m interested :-)

Re: Feature proposal: Conditional block tags

2015-01-31 Thread Raphael Michel
Hi, Am Sat, 31 Jan 2015 18:12:57 + schrieb Unai Zalakain : > Correct me if I'm wrong but the same exact behaviour can be achieved > by: > > {% block myblock %} > {% if myvariable %} > my content > {% else %} > {{ block.super }} > {% endif %} >

Re: Django documentation doesn't show correctly in any browser

2015-01-13 Thread Raphael Michel
Am Tue, 13 Jan 2015 20:36:45 +0100 schrieb Aymeric Augustin : > Well, there are 10k subscribers to this list. Who else is seing this? I don't, and I run pretty much the same configuration (Chrome on Arch Linux on multiple computers). I think it pretty obviously

Re: ANN: Django website redesign launched

2014-12-17 Thread Raphael Michel
Hi, I agree with Tino in most points. Thanks to the volunteers who did this and I really love the fact, that I can finally browse the docs on a mobile device. Great! But there certainly is a loss of both originality and the readability. Both of these things are no blockers and don't make the new

Re: Storage engine aliases?

2014-10-02 Thread Raphael Michel
Hi, Am Thu, 2 Oct 2014 08:46:26 +0200 schrieb Jannis Leidel : > If something like that were be tried I would also recommend to fix > the ambiguity with regard to “media” and “static” by renaming the > first to “uploads”. > > What do others think about that idea? Too much effort