As a note, MariaDB also has regex_replace support (since 2013), but I don't believe MySql does yet. People have implemented it via User Defined Functions.
SQLite can support it if using the icu_replace extension module. What is the current Django best practice for optionally available functionality? I know there's comments in GeoDjango about needing the extensions for the database, but is this something that should be done for specific functions? Would a good log message and exception be okay? On Sun, Dec 3, 2017 at 3:58 PM, Josh Smeaton <[email protected]> wrote: > Hey Joey, > > I think you can create a new ticket for this function. If there is a way > to approximate or implement this function in all 4 supported backends then > that would be preferred. If it can only really be implemented in postgres, > then document in the ticket why, and you can add the new function to > contrib.postgres. Hope that helps? > > On Friday, 1 December 2017 05:22:32 UTC+11, Joey Wilhelm wrote: >> >> Ping! >> >> Is there any chance of getting some additional guidance on these? I'd >> love to get these contributed, if they are welcome! >> >> -Joey Wilhelm >> >> On Fri, Nov 17, 2017 at 1:22 PM, Joey Wilhelm <[email protected]> wrote: >> >>> I did come upon that ticket, but I wasn't sure this necessarily belonged >>> as part of it, given that these are not methods which are widely available >>> across different engines. That said, I would gladly add them there. I'm >>> just eager to spin up a PR or two. :-) >>> >>> On Fri, Nov 17, 2017 at 1:12 PM, Matthew Pava <[email protected]> wrote: >>> >>>> I wonder if we should put that in this ticket: >>>> >>>> https://code.djangoproject.com/ticket/28643 >>>> >>>> >>>> >>>> >>>> >>>> *From:* [email protected] [mailto:django-d...@googlegrou >>>> ps.com] *On Behalf Of *Joey Wilhelm >>>> *Sent:* Friday, November 17, 2017 2:02 PM >>>> *To:* [email protected] >>>> *Subject:* Additional PostgreSQL-specific functions >>>> >>>> >>>> >>>> Greetings, >>>> >>>> >>>> >>>> Yesterday I opened a ticket[1] for a "RegexpReplace" method for >>>> PostgreSQL. After some talk and encouragement over in IRC, I have >>>> additionally created a "SubstrFrom" function for PostgreSQL, which allows >>>> you to use a regex match in order to extract your substring. >>>> >>>> >>>> >>>> So at this point, I have a couple of questions. >>>> >>>> >>>> >>>> 1) Are these things which would likely get integrated into core? >>>> >>>> 2) If so, should I put them into separate tickets or would I be able to >>>> combine them into a single? >>>> >>>> 3) Should they be added to the PostgreSQL specific library? Oracle does >>>> have both of these pieces of functionality, but I believe it is the only >>>> popular engine aside from PostgreSQL which does. >>>> >>>> >>>> >>>> I have the code for both of these implemented in my local project, >>>> along with tests, so I would love to contribute them if possible. >>>> >>>> >>>> >>>> Thank you! >>>> >>>> >>>> >>>> >>>> >>>> [1]: https://code.djangoproject.com/ticket/28805 >>>> >>>> -- >>>> 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 [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at https://groups.google.com/group/django-developers. >>>> To view this discussion on the web visit https://groups.google.com/d/ms >>>> gid/django-developers/CADBkHd%2Be3GodbKvDFXq0dAgwzs4n%3DFgLG >>>> HTYsbhuiQWDOcB64Q%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/django-developers/CADBkHd%2Be3GodbKvDFXq0dAgwzs4n%3DFgLGHTYsbhuiQWDOcB64Q%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>>> -- >>>> 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 [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at https://groups.google.com/group/django-developers. >>>> To view this discussion on the web visit https://groups.google.com/d/ms >>>> gid/django-developers/fa1db399bca544eebeeb0b261752ffeb%40ISS1.ISS.LOCAL >>>> <https://groups.google.com/d/msgid/django-developers/fa1db399bca544eebeeb0b261752ffeb%40ISS1.ISS.LOCAL?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >> -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-developers. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-developers/6560985c-9d33-4837-9af5- > ee467ae5369b%40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/6560985c-9d33-4837-9af5-ee467ae5369b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Joe Tennies [email protected] -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CACiOJ6tvZ8BiBJ8_xYaxvsoHkKXAOqyOsaHXbnrxaYppcM%2BFbA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
