Re: Request to reconsider ticket #27910: using an Enum class in model Field choices
Hi Fernando, On Mon, 16 Sep 2019 08:59:17 -0700 (PDT) Fernando Macedo wrote: > Hi everyone, I come late to the party and only noticed that Django > now has support for enums on the 3.0 release notes. As I'm not a core > developer I never imagined this. Late is better than never... I should point out that contribution to the project is open -- neither I, who initiated this work, nor Nick, who pulled most of the rest of the way, are currently members of the project's Technical Team ("core developers"). This, of course, is not intended as an admonition, but rather as an invitation. Come join us, one and all! > > I've wrote a lib that does something similar in mid-2018: > https://github.com/loggi/python-choicesenum > > There's one main diff from the Python default behaviour: The default > enum requires that you compare the enum against their value, > something like `assert EnumClass.EnumItem.value == 3`, my custom > implementation allow usage with `assert EnumClass.EnumItem == 3`, the > expected behaviour IMHO. > I believe Django's enum classes also have this property. I took a short glance at your implementation, and I believe Django's has most of its features; you're welcome to take a look at ours[1] and note if we missed anything important. If we did, perhaps there's still time to fix it before the Beta. [1] https://github.com/django/django/blob/stable/3.0.x/django/db/models/enums.py Thanks for coming forward with this, Shai. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/20190918104033.2618863b.shai%40platonix.com.
Fellow Reports -- September 2019
Hi all. Calendar Week 36 -- ending 08 September. Triaged: https://code.djangoproject.com/ticket/30759 -- Make cache.delete() return whether or not it suceeded. (Accepted) https://code.djangoproject.com/ticket/30756 -- ModelForm does not work well with the override field on Inherited Model (Duplicate of #30427) https://code.djangoproject.com/ticket/30753 -- Add 'Did you mean...' when TemplateDoesNotExist occurs (Accepted) https://code.djangoproject.com/ticket/30755 -- Have django.views.generic.base.View.as_view() check argument type, via annotations. (needsinfo) https://code.djangoproject.com/ticket/30749 -- Admin date_hierarchy filter by month of October 2019 does not include October 31th when TZ is set to Europe/Paris (UTC+2) (Duplicate of #29724.) https://code.djangoproject.com/ticket/39746 -- Add Feature-Policy header support (Accepted) https://code.djangoproject.com/ticket/30745 -- Allow serving a default file for FileField from static URL.! (needsinfo) https://code.djangoproject.com/ticket/30705 -- Django template permissions not working when used inside the template of an inclusion tag (Invalid) https://code.djangoproject.com/ticket/30742 -- ModelForm should allow passing update_fields to instance.save() (wontfix) Reviewed: https://code.djangoproject.com/ticket/30573 -- Don't assume that things are "easy"/"obvious"/"simple" in the docs. https://github.com/django/django/pull/11280 -- Fixed #30386 -- Added pk quoting for admin ForeignKey widgets. https://github.com/django/django/pull/11721 -- Changed example git clone URLs to use HTTPS. https://code.djangoproject.com/ticket/29714 -- Make it easier to customise ExceptionReporter output. https://code.djangoproject.com/ticket/28699 -- Document that REMOTE_USER must be logged in before making CSRF protected requests. https://github.com/django/django/pull/11623 -- Refs #29379 -- Moved autocomplete attribute to UsernameField. https://github.com/django/django/pull/9884 -- Fixed 29336 -- Added docs for circular template inheritance. Authored: https://github.com/django/django/pull/11738 -- Refs #28699 -- Doc'd that CSRF middleware must be before any auth middleware https://github.com/django/django/pull/11736 -- Fixed #30747 -- Renamed is_safe_url() to url_has_allowed_host_and_scheme(). Calendar Week 37 -- ending 15 September. Released Django 3.0a1. Triaged: https://github.com/django/djangoproject.com/issues/941 -- 404 for https://docs.djangoproject.com/en/3.0/releases/3.0/ (Accepted) https://code.djangoproject.com/ticket/30765 -- cache_control() "max_age" overrides cache_page() "timeout" (Accepted) https://code.djangoproject.com/ticket/30753 -- Add 'Did you mean...' when TemplateDoesNotExist occurs (wontfix) Reviewed: https://github.com/django/djangoproject.com/pull/903 -- Relocate doc search bar https://code.djangoproject.com/ticket/30752 -- Allow using ExceptionReporter subclass in django.views.debug.technical_500_response https://github.com/django/django/pull/11745 -- Bootstrapped Django 3.1. https://github.com/django/django/pull/11606 -- Fixed #28107 -- Added DatabaseFeatures.allows_group_by_selected_pks_on_model() to allow enabling optimization for unmanaged models. https://code.djangoproject.com/ticket/29406 -- Add Referrer-Policy header support https://code.djangoproject.com/ticket/30767 -- Docs: deployment landing page is scarce Authored: https://github.com/django/djangoproject.com/pull/943 -- Added docs warning banner to preview releases. https://github.com/django/django/pull/11775 -- Increased the default PBKDF2 iterations for Django 3.1. https://github.com/django/django/pull/11774 -- Expanded notes on alphas in release How-to. Kind Regards, Carlton -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/f1802fc9-b365-4cbd-b0a1-ff36cd9e4a3e%40googlegroups.com.
Re: Individial Member Nomination for the DSF: Louise Grandjonc
My apologies friends, this was intended for the DSF members mailing list. I had a momentary brain freeze! On Tuesday, September 17, 2019 at 5:15:23 PM UTC-4, Tim Allen wrote: > > Good afternoon friends, happy "four days until DjangoCon US!" > > I'd like to nominate Louise Grandjonc to the Django Software Foundation. > Louise has given excellent talks on scaling multi-tentant apps using > Django's ORM and PostgreSQL, and will be presenting at DjangoCon US this > year. She's written numerous blog posts that have been extremely helpful to > me in understanding the inner workings of PostgreSQL, and is interested in > getting more involved with Django. > > She's also quite an artist, as you can see is some of her hand-dawn > slides: > https://speakerdeck.com/citusdata/scaling-multi-tenant-applications-using-the-django-orm-and-postgres-pycaribbean-2019-louise-grandjonc > > Can I get some plus ones? :) > > Regards, > > Tim > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/f13e010a-03e6-4674-8db0-1a2f71e67aca%40googlegroups.com.
Re: Cross-DB JSONField ready for review
Hi Ole and Matt, Sorry for getting back so late. I agree that having such a function would be very useful. I believe it can be done with most of the current implementation because I actually needed to compile the JSON path string from the KeyTransforms (except for PostgreSQL that uses a different syntax of its own). So, maybe I just need to add a check if it's an instance of JSONExtract and adapt accordingly. However, I'm not really sure about killing the other lookups. I agree that it interferes with the possibility of using the lookup names as keys, but I was trying to retain all the functionalities from the original JSONField to make migration less painful. Mariusz is going to prepare a review for the current implementation, so I think we'll be able to have a discussion about this as well. Regards, Sage On Friday, 13 September 2019 11:09:14 UTC+7, schinckel wrote: > > Hi Ole, > > I'm interested in what you are trying to do with JSONExtract. I have a > subclass of Func called JSONBExtractPathText that I use with great success > to extract parts of a JSONB object. > > Also, as of Django 3.0, you can filter directly on an expression (that has > an output_field of BooleanField). > > Thus, you could write your first example as: > > MyModel.objects.filter(JSONBExtractPathText('field', Value('Foo the > bar?'), output_field=models.BooleanField()) > > I think you could possibly do the other stuff using either an > ExpressionWrapper, or at worst a Case(When()). > > (I hang out on #django on IRC if you want to discuss this in a more > interactive manner). > > Matt. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/d3199e1e-97ed-4196-a94a-809e0eb063b0%40googlegroups.com.